Hello, I have done a small code to keep selection during scroll pagination.
You can found my answer on stackoverflow :
http://stackoverflow.com/questions/4063938/flexigrid-selection-of-row...
The code :
$("#searchPhonoList").flexigrid($.extend({}, flexigridAttrs, {
url: './rest/phono/search',
preProcess: formatSearchPhonoResults,
onSuccess: successSearchPhono,
onSubmit: submit,
method: 'GET',
dataType: 'json',
colModel : [
{display: 'titre', name: 'titre_brut', width : 240,
sortable : true, align: 'left'},
{display: 'version', name: 'version_brut', width : 60,
sortable : true, align: 'left'}
],
height: "auto",
sortname: "score",
sortorder: "desc",
showTableToggleBtn: false,
showToggleBtn: false,
singleSelect: false,
onToggleCol: false,
usepager: true,
title: "Liste des candidats",
resizable: true,
rp:20,
useRp: true
}));
var searchPhonoListSelection = new Array();
$('#searchPhonoList').click(function(event){
$(' tbody tr', this).each( function(){
var id = $(this).attr('id').substr(3);
if ( searchPhonoListSelection.indexOf(id) != -1 ) {
searchPhonoListSelection.splice(searchPhonoListSelection.indexOf(id), 1);
}
});
$('.trSelected', this).each( function(){
var id = $(this).attr('id').substr(3);
if ( searchPhonoListSelection.indexOf(id) == -1 ) {
searchPhonoListSelection.push(id);
}
});
});
function successSearchPhono() {
$("#searchPhonoList tbody tr").each( function() {
var id = $(this).attr('id').substr(3);
if ( searchPhonoListSelection.indexOf(id) != -1 ) {
$(this).addClass("trSelected");
}
});
}
On Monday, April 13, 2009 8:06:57 AM UTC+2, Saurabh wrote:
> Hi,
> I am evaluating various javascript based datagrid that i can use in my
> application. I have looked at demos of flexigrids.
> I want to know if its is possible that row selection persists across
> the page change. e.g.
> I select row 2,5,7 on page 1 and then i change to page 2 and select
> 20,25. I go back to page one ... will i get 2,5,7 pre selected ?
> OR
> is scroll pagination possible in flexigrid. by scroll pagination i
> mean AJAX loads more data when i have scrolled to last row. kind of
> auto pagination
> Thanks & Regards,
> saurabh