jQWidgets Forums

jQuery UI Widgets Forums Grid Dealing with dynamic columns

This topic contains 3 replies, has 2 voices, and was last updated by  Hristo 6 years, 7 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Dealing with dynamic columns #103236

    walker1234
    Participant

    I have this JSFiddle where I’m converting the JSON string array to Javascript object:

    http://jsfiddle.net/9ux0h7nz/

    And, the data is dynamically generated and I am going to have different columns. IS it possible to generate jQXgrid based on the the dynamically generated javascript object? Please let me know if there’s an example showing this.Thanks

    Dealing with dynamic columns #103239

    Hristo
    Participant

    Hello walker1234,

    We have similar discussions in our forum (searched as “Dynamic columns”).
    I would like to suggest you look at this one and also this.

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

    Dealing with dynamic columns #103246

    walker1234
    Participant

    Thanks. I am referring to one of the examples that you mentioned.

    1) Can you take a look if I am moving in right direction:

    In this JSFiddle, I was able to create the datafields array and get the name of the columns as shown in the console log of the JSFiddle (image below):

    Is that correct?

    2) While building the source, I am not sure what would be my localdata value? I am guessing I would need to pass the values of each key?I am little confused here.

    Dealing with dynamic columns #103249

    Hristo
    Participant

    Hello,

    As I saw you get already the datafields now you (“Keys”).
    For your localdata you could set the extracted data (“Values”).
    Also, you should set correctly the columns property.
    Each one ‘column’ should have relevant and the same named datafield as it is in the array of the datafields.

    columns: [
    	{ datafield: "FIRST HEADING" },
    	...
    ]

    Best Regards,
    Hristo Hristov

    jQWidgets team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.