jQWidgets Forums
Forum Replies Created
-
Author
-
now i understand.. that would be good in the documentation.
Thanks
Peter, I cannot get this working – beforeLoadComplete (newrecords, originalrecords)
originalrecords doesn’t hold the old records. originalrecords and newrecords contain same data.
Hi Peter,
I’m actually trying to detect data changes and process the data before the grid is rendered.
The dataadapter has beforeLoadComplete event with originalrecords and newrecords.
I was thinking using this event to determine the changed data?December 22, 2015 at 8:17 am in reply to: jqxgrid jsonp and observable array jqxgrid jsonp and observable array #79638Hi Peter,
I like the idea of detecting changes in the data for the grid to render where required.
What data structures are required to use observable array?
Could i continuously convert the json data into a local array for observable array to use?October 14, 2015 at 6:40 am in reply to: TypeError: Cannot read property 'style' of undefined TypeError: Cannot read property 'style' of undefined #76834I was preparing the jsfiddle and i noticed https://jqwidgets.com/public/jqwidgets/jqx-all.js is now jqwidgets-ver3.9.0
I tested my existing code from jqwidgets-ver3.8.2 to use jqwidgets-ver3.9.0 and it no longer has the error.
The error has been fixed in your jqwidgets code somewhere between ver3.8.2 to 3.9.0.
FYI, since using 3.9.0 i’ve noticed nothing else broken, all good.
October 14, 2015 at 5:27 am in reply to: TypeError: Cannot read property 'style' of undefined TypeError: Cannot read property 'style' of undefined #76829When i simply revert from jqwidgets-ver3.8.2 back to jqwidgets-ver3.6.0 (no other code changes) the problem does not occur.
So something underlying has changed.I’ll try and get a jfiddle to demonstrate the problem.
October 13, 2015 at 12:45 pm in reply to: Theme Builder – not loading Theme Builder – not loading #76784ok got it.
Thank you Peter.
Peter
You’re absolutely right there, I’m lucky to have a very simple requirement at this stage.
In a future version i would like to know which data cells to colourise to signify change.
I’m guessing comparing the records array from beforeLoadComplete(records) function with another records array of the existing grid recordset?
Is there an internal array for existing records? or it is accessed via getrowdata?
var data = $(‘#jqxGrid’).jqxGrid(‘getrowdata’, 0);Peter,
Thanks for your help.
For those interested:-
I used a $(“#jqxgrid”).jqxGrid(“getdatainformation”).rowscount to obtain the current count of rows.
Then compared to the array passed in from beforeLoadComplete(records) functionrecords.length > $(“#jqxgrid”).jqxGrid(“getdatainformation”).rowscount // Check if new records?
Hello Peter,
Thank you for your response.
I’ve attempted to use the beforeLoadComplete function.
From what i understand this function takes two parameters being the new records and old records arrays.
What i observe is that new and old record arrays are the same, i.e. no difference.
Am i using this function correctly?I first use $(‘#jqxgrid’).jqxGrid(‘updatebounddata’); to get data.
Then wait in beforeLoadComplete function to determine differences in the data.
I compare the new and old arrays for any difference but the arrays are the same.Here is my code
refresh_data = function () {
$(‘#jqxgrid’).jqxGrid(‘updatebounddata’);
}var dataAdapter = new $.jqx.dataAdapter(source,
{
formatData: function (data) {
return “{}”;
},
beforeLoadComplete: function (newrecords,oldrecords) {
if (newrecords.length > oldrecords.length) { // code break here shows both arrays are the same.
$.playSound(‘sounds/alarm.mp3’);
}
return newrecords;
}});
March 17, 2015 at 6:02 am in reply to: pager items – making bigger pager items – making bigger #68650Thank you for this.
-
AuthorPosts