EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
May 17, 2024, 02:47:58 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
select all in datagrid with scrollview [SOLVED]
Pages: [
1
]
« previous
next »
Print
Author
Topic: select all in datagrid with scrollview [SOLVED] (Read 5634 times)
Max Lamda
Newbie
Posts: 48
select all in datagrid with scrollview [SOLVED]
«
on:
December 20, 2017, 08:34:42 AM »
Hi,
is there any solution for the "selectAll" function in a datagrid with scrollview?
Can one load all data somehow unvisible into the grid and do only the rendering of the grid on the scoll-events?
Or can one access the array returned by
datagrid('getSelections') and modify it, that it could contain ALL data? This should be sufficent to make an Ajax-call and get the whole data.
Thanks in advance.
«
Last Edit: December 21, 2017, 02:52:42 AM by Max Lamda
»
Logged
Max Lamda
Newbie
Posts: 48
Re: select all in datagrid with scrollview
«
Reply #1 on:
December 20, 2017, 08:39:03 AM »
Should I try to change
$('#dg').data('datagrid').selectedRows
or
$('#dg').data('datagrid').checkedRows
?
Logged
Max Lamda
Newbie
Posts: 48
Re: select all in datagrid with scrollview
«
Reply #2 on:
December 20, 2017, 09:00:16 AM »
I now do the following:
onSelectAll: function() {
var dg=$(this);
var opts=dg.datagrid('options');
var params={
sort: opts.sortName,
order: opts.sortOrder,
page:1,
rows: dg.datagrid('getData').total
};
$.extend(params,opts.queryParams);
$.post(opts.url, params, function(data) {
dg.data('datagrid').selectedRows = data.rows;
dg.data('datagrid').checkedRows = data.rows;
},'json');
},
Seems to work at first glance, but is that reliable?
«
Last Edit: December 20, 2017, 09:32:26 AM by Max Lamda
»
Logged
stworthy
Administrator
Hero Member
Posts: 3581
Re: select all in datagrid with scrollview
«
Reply #3 on:
December 20, 2017, 06:24:20 PM »
Yes, you can set the selected rows by setting the 'selectedRows' manually. Please refer to this example
http://code.reloado.com/atopug3/edit#javascript,html,live
Logged
Max Lamda
Newbie
Posts: 48
Re: select all in datagrid with scrollview
«
Reply #4 on:
December 21, 2017, 02:52:30 AM »
Ok, thanks alot.
I just wasn't sure if I may manipulate this (kind of private) data directly.
My approach should work automatically if server-side reads the query-Params correctly.
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...