Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
245
igGrid LoadOnDemand and Selection Persistence
posted

Hi Martin,

I am using SelectionPersistence.js you provided to me.

I am enabling filtering with selection persistence.

Here is the grid code and associated events.

<script> $.ig.DataSource.prototype.settings.paging.pageIndexUrlKey = "page"</script>
@(Html.Infragistics().Grid(Model.Customers.AsQueryable())
.Width("400px")
.Height("300px")
.AutoGenerateColumns(false)
.ResponseDataKey("Records")
.Features(feature =>
{
    feature.Filtering().Type(OpType.Remote);
    feature.LoadOnDemand().ChunkSize(10).LoadTrigger(LoadTrigger.Button);
})
.DataSourceUrl(Url.Action("GetAllC"))
.DataBind()
.Render()
)

Here are event I attached 

var sp;
$.ig.DataSource.prototype.settings.paging.pageIndexUrlKey = "page";
$(document).on("iggridrendered", "#myIGrid", function rendered(evt, ui) {
sp = SelectionPersistence(ui.owner);
sp.enableFiltering();
});

Issue #1: With above code persistence works fine. But I error in below deselecting scenario

1. Select a row.

2. Filter(remote)--enter some characters in filter text box for any column

3. Remove text from filter text box

4. Try to deselect a selected record.

5. I get the error when deselection row at row index 1: 

              Unhandled exception at line 366, column 12789 in http://cdn-na.infragistics.com/jquery/20132/latest/js/infragistics.lob.js

              0x800a138f - Microsoft JScript runtime error: Unable to set value of the property '1': object is null or undefined.

6. I do not get this error when I user selection with sorting. It is coming only with filtering.

7. I used IE 9(standard mode)


Issue 2: When I enable LoadOnDemand for grid, and do below operations, I see that some issues mentioned below

1. I have chunk size as 10

2. I select record in 2nd row and 3rd row

3. I filter grid for record which is not in 1st chunk. Grid bring data remotely, I select it which happened to be record 11 and removes text from filter.

4. Again, 1st 10 records are displayed with 2nd and 3rd row selected.

5. Now I press LoadOnDemand button at the bottom of the grid.

6. Row 11 is not selected. (How to make sure that on loadOnDemand, selection persistence works).

I hope I am clear now.

I thankful for your valuable inputs.

Thanks,

Rajesh