EasyUI Forum
March 04, 2024, 12:14:04 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Datagrid get row by index in pagination  (Read 769 times)
Wojak
Newbie
*
Posts: 45


View Profile Email
« on: February 01, 2023, 05:47:09 AM »

Hey,
The problem I have is that when I fetch all the rows from the datagrid with pagination and want to find it by index it doesn't find it. If pagination is set to 100 rows then being on 400 row it shows no row found

Code:
const id_found = $('#example-dg').datagrid('getRowIndex', id);
const row = $('#example-dg').datagrid('getRows')[id_found];

if (row) {
    // Some code
} else {
    $.messager.alert("Alert", "Not found !!!", "warning");
}
Logged
jarry
Administrator
Hero Member
*****
Posts: 2260


View Profile Email
« Reply #1 on: February 02, 2023, 02:00:04 AM »

The 'getRowIndex' method only returns the loaded row index in a page. If the loading data exceeds the page size, it will be cut off before loading into the datagrid.
Logged
Wojak
Newbie
*
Posts: 45


View Profile Email
« Reply #2 on: February 02, 2023, 10:23:48 AM »

So if pagination is set to 100, getRows will return only 100 rows and not 400? I'm just curious why when I'm on the 200th line it works and on the 3xx it doesn't
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!