Problem with Large Dataset during save

hi ,
I have a problem when i am trying to save the data in the listgrid with more than 45 records.

I am using datasource which is getting records from the database.

i have a listgrid with properties as below

isc.ListGrid.create({
		ID: "listSample",
		autoDraw: true,
		autoFetchData: false,
		height:300,
		showAllRecords:true,
		headerHeight: 40, 
		border:"0px solid #ffffff",
		dataSource: listSampleDS,
		canEdit: true,
		canSort: true,
		editEvent: "click",
		editByCell: true,		    	
		canReorderFields: false,
		canResizeFields: false,			
		modalEditing:true,
		autoSaveEdits:false,
		editPendingBaseStyle: "myBoxedGridCellEdited", 		
		showRollOver:false,
		showSortArrow: false,
		leaveScrollbarGap: false,
		saveByCell:false,
		confirmDiscardEdits:false,
		arrowKeyAction:"select",
		showHeaderContextMenu:false, 
		baseStyle: "myBoxedGridCell",
		wrapCells:true,
		fields:	[		
			{name:"name",  title:"name", canEdit:true, canSort: false, wrap: true, width: 100, align: "center", cellAlign: "right"},
       			{name:"score1",  title:"score1", canEdit:"true", canSort: false, wrap : true, width : 100, align: "center", cellAlign: "right"},
       			{name:"score2",  title:"score2", canEdit:"true", canSort: false, wrap : true, width : 100, align: "center", cellAlign: "right},               
        		{name:"score3",  title:"score3", canEdit: true, canSort: false, wrap: true, width: 100, align: "center", cellAlign: "right"}
		]});

I have a button on click of which i am getting the values from the listgrid and passing them to the server.

code on click of the button is given below

var maxRows = listSample.getTotalRows();
var scoreOne = new Array();
for(var iCount = 0; iCount < maxRows; iCount++)
	 	{
			updatedRecord = listSample.getEditedRecord(iCount);
                        scoreOne [iCount ] = updatedRecord.score1;
                       }
listSample.updateData(objRecord,null,{params:{Score:scoreOne}});

The value of score1 is getting passed correctly when the number of records is less than 45.
when i have more than 45 records the score1 values are going as “undenfined” from the screen.

For example if there 53 records in the listgrid , for the first 10 records value is passed as “undefined” and for the remaining records correct values are getting passed.

what might be the cause for these wrong values .
Please help me to solve this issue.

Problem with Large Dataset during save

Hi ,
I got a workaround for this issue.When the number of records were greater than 45 , i tried increasing the height of the list grid and now the values are getting passed correctly.
Please let me know the possible cause for this issue.

Thanks,
Keerthi

Hi Keerthi,
The issue here is that databound listgrids support paging by default – they only load the set of records the user can see rather than fetching every record in the data-set from the server, for performance. There are various ways to configure this - search the documentation for showAllRecords and dataPageSize, for example.

Since not all the records have been fetched from the server when your method runs, you’re getting some unexpected null entries in the data you pick up.

It seems like saveAllEdits() will give you the behavior you want without having to write this custom code, no?

Thanks
Isomorphic Software

Hi,
Thanks for the reply.
In the listgrid property, i have already given showAllRecords:true.
And in the server side also i am setting the total rows in the dsresponse as the number of records fetched from the database.
So I should be having all the records in the client side.
But still I am facing this problem
I also tried giving dataPageSize property also.But still the problem exist.

Please help to solve this issue.

Thanks,
Keerthi

Hi Keerthi,

Can you please take the next few steps recommended by the Debugging chapter of the docs - for example, use isc.echo() to inspect the values you are getting back from getEditedRecord() and also values from getRecord(), to ensure that, in fact, your data is valid. If you do this, please log the results and post them here.

I suspect the problem is in code you aren’t showing us, for example, perhaps you have implemented a formatCellValue() or other override that either sets record.score1 or calls listGrid.setEditValue(“score1”) ? formatCellValue() is only called for visible cells and would be the wrong place to establish initial values for score1, if that’s what you’re doing.