jQWidgets Forums

jQuery UI Widgets Forums Grid How to get raw or custom row data

This topic contains 2 replies, has 2 voices, and was last updated by  zorgoz 10 years, 7 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • How to get raw or custom row data #61561

    zorgoz
    Participant

    Hi,

    I have a project where I need to make some custom column data visualization. My data source is in dynamic JSON, coming from a server. I am well able to do the custom display itself using the cellsrenderer callback.
    But, the data I need to process to determine how exactly to render is comming in the returned json array as a “field” of the “row” array (trainings). It is json-encoded as an object. I can not specify this field in the dataadapter’s datafields section since it’s type is not one of the supported ones. It is an object. I tried to add { name: 'trainings', type: 'string' }, as well as { name: 'trainings', type: 'object' }, but I had o success to get it’s content back in the cell renderer. After calling var datarow = $("#jqxgrid").jqxGrid('getrowdata', row); “trainings” is there, but as an empty object, without it’s content.

    How can I access this data field of the source? Is there any chance to access the raw source from within the cell renderer?

    Thank you in advance,

    How to get raw or custom row data #61569

    Peter Stoev
    Keymaster

    Hi zorgoz,

    The dataAdapter can load strings, bool, date and numbers. It cannot load objects. If you need to specify the path to the simple parts of your objects, you can define mapping in the dataAdapter’s source object. For more information: http://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxgrid/jquery-grid-datasources.htm

    Best Regards,
    Peter Stoev

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

    How to get raw or custom row data #61595

    zorgoz
    Participant

    Thank you. Well, I that’s not good for me. There is no discrete mapping that can be set up in advance. It’s too bad, that the data adapter is cutting any connection to original data source.
    Still, I managed to overcome this problem, by passing the object as json encoded string. Thus I can recreate the object in the cellrenderer. Still, this is not neat, and I am afraid of performance issues.

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

You must be logged in to reply to this topic.