jQuery UI Widgets › Forums › Plugins › Data Adapter › Not able to access the Data Adapter with in the bind complete event.
Tagged: beforeLoadComplete, jqxDataAdapter
This topic contains 3 replies, has 2 voices, and was last updated by Peter Stoev 9 years, 8 months ago.
-
Author
-
August 20, 2015 at 7:38 am Not able to access the Data Adapter with in the bind complete event. #74977
var data= [{
“id”: “17”,
“text”: “13g protein”,
“parentid”: “13”
}, {
“id”: “14”,
“text”: “Caffe Vanilla Frappuccino Light”,
“parentid”: “12”
}];// prepare the data
var source =
{
datatype: “json”,
datafields: [
{ name: ‘id’ },
{ name: ‘parentid’ },
{ name: ‘text’ }
],
id: ‘id’,
localdata: data
};// create data adapter.
var dataAdapter = new $.jqx.dataAdapter(source ,
beforeLoadComplete: function () {
// get data records.
var records = dataAdapter.records;
var length = records.length;}
);
Encountering with the unidentified object when i am accessing the data adapter with in the beforeLoadcomplete event in above mentioned example .
Could you please suggest how to access the adapter with in the beforeLoadComplete event in above mentioned case .August 20, 2015 at 8:22 am Not able to access the Data Adapter with in the bind complete event. #74979Hi sairam,
You use beforeLoadComplete which means that this is callback function as its name states, that is called before the data loading is completed which means that dataAdapter.records is Empty there. I suggest you to refer to examples on our website to learn how to use that plugin.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comAugust 20, 2015 at 10:56 am Not able to access the Data Adapter with in the bind complete event. #74989Hi Peter ,
Thanks for your response . Now i change the call back method to loadComplete in the same example and tried to access the adapter in call back method . encountered with the same issue .
August 20, 2015 at 11:11 am Not able to access the Data Adapter with in the bind complete event. #74993Hi sairam,
Refer to: http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxdataadapter/jquery-data-adapter.htm
Working samples are available there and some of them use beforeLoadComplete and loadComplete. Use the same approach to get the desired results. Also, clear your browser’s history when you test.Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.