jQuery UI Widgets Forums Grid Fail to get records from dataAdapter

This topic contains 1 reply, has 2 voices, and was last updated by  Dimitar 10 years, 4 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • moomoo
    Participant

    Hi,

    I have a blank jqxGrid.
    User will click on add button to add new row and edit cells value.
    After that will, user will click save button to save record to server. (User might add in few rows of records)
    I am trying to loop through dataAdapter.records to get all the new records and add into array with few other info before sending to server.
    However, dataAdapter.records is an empty array while all the records i found are in dataAdapter.cachedrecords
    Is there anything i miss out in order to get values from dataAdapter.records?

    data adapter

    var source = {
    	datatype: "json",
    	datafields: [
    	{ name: 'lineNo', type: 'int'},   
    	{ name: 'name', type: 'string' },
    	{ name: 'email', type: 'string' }
    	],
    	url: 'getValues'
    };
    
    var dataAdapter = new $.jqx.dataAdapter(source);

    jqxgrid param

    source: dataAdapter,
    editable: true,
    selectionmode: 'singlerow',
    editmode: 'dbclick',

    add new row
    $("#myTbl").jqxGrid('addrow', null, row);

    thanks


    Dimitar
    Participant

    Hello moomoo,

    dataAdapter.records has the initially loaded records. You can get all current ones with the getrows method.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.