jQWidgets Forums

jQuery UI Widgets Forums Grid Column displayfield

This topic contains 10 replies, has 2 voices, and was last updated by  riccitelli 12 years, 6 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
  • Column displayfield #14916

    riccitelli
    Member

    Hi all,

    I’ve a problem with displayfield property of column.

    The value displayed isn’t the field I select in data source by displayfield property but the datafield one.

    I don’t understand how to display a value and how to use another one for array returned by getrows method.

    Thx in advance

    Column displayfield #14917

    Peter Stoev
    Keymaster

    Hi riccitelli,

    The following sample shows how to create a Column with Display and Value fields: gridkeyvaluecolumn.htm.

    In case the Key/Value column is editable, check this sample, too: gridkeyvaluescolumnwitharray.htm.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Column displayfield #15050

    riccitelli
    Member

    I have a datasource in Json format like this:

    "[{"id":2,"parentId":1,"text":"[String] host","tag":"host|String|host"},{"id":3,"parentId":1,"text":"[String] category","tag":"category|String|category"},{"id":4,"parentId":1,"text":"[Integer] eventCode","tag":"eventCode|Integer|eventCode"},{"id":5,"parentId":1,"text":"[Integer] eventIdentifier","tag":"eventIdentifier|Integer|eventIdentifier"},{"id":6,"parentId":1,"text":"[String] message","tag":"message|String|message"},{"id":7,"parentId":1,"text":"[Integer] recordNumber","tag":"recordNumber|Integer|recordNumber"},{"id":8,"parentId":1,"text":"[String] rawMessage","tag":"rawMessage|String|rawMessage"},{"id":9,"parentId":1,"text":"[Date] timeGenerated","tag":"timeGenerated|Date|timeGenerated"},{"id":10,"parentId":1,"text":"[String] ownDesc","tag":"ownDesc|String|ownDesc"},{"id":11,"parentId":1,"text":"[String] domain","tag":"domain|String|domain"},{"id":12,"parentId":1,"text":"[String] user","tag":"user|String|user"},{"id":13,"parentId":1,"text":"[String] accessId","tag":"accessId|String|accessId"},{"id":14,"parentId":1,"text":"[String] accessType","tag":"accessType|String|accessType"},{"id":15,"parentId":1,"text":"[String] originalMachine","tag":"originalMachine|String|originalMachine"},{"id":16,"parentId":1,"text":"[String] originalIp","tag":"originalIp|String|originalIp"},{"id":17,"parentId":1,"text":"[String] originalPort","tag":"originalPort|String|originalPort"}]"

    I bind the text field how displayfield but i view in the grid always the datafield (tag).

    This is my jqxGrid definition:

    $("#gridStepSixMapping").jqxGrid(
    {
    width: 400,
    theme: 'classic',
    source: dataAdapter,
    pageable: true,
    autoheight: true,
    altrows: true,
    enabletooltips: true,
    editable: true,
    columns: [
    { text: 'Mapping', displayfield: 'text', datafield: 'tag', width: 200, editable: false },
    { text: '@Resources.Global.Path', datafield: 'source', width: 200, editable: false },
    ]
    });

    Thx you

    Column displayfield #15053

    Peter Stoev
    Keymaster

    Hi riccitelli,

    Please, ensure that you use the correct version of jQWidgets and especially jQWidgets 2.7. In case you use the latest version, then please provide your dataAdapter’s initialization code, too.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Column displayfield #15054

    riccitelli
    Member

    jqxWidgets version is old… 2.5.0. Updating to the latest version is in roadmap.

    My dataAdapter initialization code:

    var source =
    {
    localdata: sources,
    datatype: "json"
    };
    var dataAdapter = new $.jqx.dataAdapter(source);

    Sources is an array on which JSON.stringify method has been applied.

    Column displayfield #15056

    Peter Stoev
    Keymaster

    Hi riccitelli,

    The API available on our website is valid only for the latest version which is jQWidgets 2.7. The API available for the version that you use is available in your download package for jQWidgets 2.5

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Column displayfield #15061

    riccitelli
    Member

    Is it possible to have download package of 2.5 version ? Unfortunately I’ve lost it

    Column displayfield #15064

    Peter Stoev
    Keymaster

    Hi riccitelli,

    Here’s a link: jqwidgets-ver2.5.zip.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Column displayfield #15075

    riccitelli
    Member

    The example is not available in 2.5.0. Do you confirm that the functionality is present from 2.5.5 version?

    Thx

    Column displayfield #15076

    Peter Stoev
    Keymaster

    Hi riccitelli,

    I am not sure on which version that feature was added, but I am sure that it is in jQWidgets 2.7, because it is included in the online documentation.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Column displayfield #15077

    riccitelli
    Member

    Ok, thanks.

    Best regards

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

You must be logged in to reply to this topic.