jQuery UI Widgets Forums Grid record uid gets cleared while filtertype:'list' is used

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

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

  • Beg
    Participant

    when using source with specified id column

    var source =
      {
          datatype: "json",
          datafields: [ { name: 'test', type: 'string' }, ... ],
          id: "id",
          url: url
      };

    $(“#jqxgrid”).jqxGrid(‘getrowdata’, clickedRowNr).uid is as specified in json. So far, so good.

    But when you use filtertype:’list’ on any column, record.uid gets corrupted and is counted starting from 0.

    $("#jqxgrid").jqxGrid(
      {
          source: adapter,
          filterable: true,
          sortable: true,
          autoshowfiltericon: true,
          columns: [
            { text:'Test', datafield: 'test', filtertype:'list', width: 180 }, ...
          ]
      });

    The reason, I’ve found, is creating local dataadapter in jqxgrid.filter.js -> _getfilterdataadapter which has not set id field in source. Newly created dataadapter from this local source tries again to get new uid and failed – overwriting regular uid.
    Fix, that helped me, is adding id:'uid', into localy created source, that is passed to new dataadapter. I think it won’t harm anything as the uid should already be handled by previous datafetch, but as I have only minified code, I cannot confirm it.


    Hristo
    Participant

    Hello Beg,

    Thank you for this feedback.
    You could use “boundIndex” of the rowclick event in method – $("#jqxgrid").jqxGrid('getrowdata', boundIndex).
    Thank you for your understanding.

    Best Regards,
    Hristo Hristov

    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.