jQWidgets Forums

jQuery UI Widgets Forums Grid Add new row and export

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 11 years, 3 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Add new row and export #48318

    Snehal
    Participant

    Hi,
    I am using addRow method , like
    $(“#jqxgrid”).jqxGrid(‘addrow’, null, {“name”:”a” , “contact”:”1234″});

    it is adding row with these fields as dataField as well as displayField.
    But for column “Name”, want to use “Name” –> “a” as a displayField and its value “1” as a dataField. How to add new row like this?

    And one more question, When we export Grid data as a JSON , It is exporting its displayFields, how can we export any particular column’s dataField?
    e.g. When we export $(“#jqxgrid”).jqxGrid(‘exportdata’, ‘json’);
    The name field should export its value(dataField) “1” instead of (displayField)”a”.

    Thanks & Regards,
    Snehal.

    Add new row and export #48327

    Peter Stoev
    Keymaster

    Hi Snehal,

    – Define all necessary fields in the passed Object when you add a row. I suppose that you will have to add it in the {“name”:”a” , “contact”:”1234″}
    – The export to excel exports the data displayed in the Grid. However, the “exportdata” method allows you to pass as argument an Array of data to be exported.

    Best Regards,
    Peter Stoev

    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.