jQWidgets Forums

jQuery UI Widgets Forums Grid Keys/Values column problem

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

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Keys/Values column problem #57436

    gio
    Participant

    Hi all,
    we have a problem using the keys/values column.
    (we followed this sample: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/gridkeyvaluescolumnwitharray.htm?web)

    After grid binding, the cell with foreign values is always empty.

    Here the some parts of our code:

    valueTypes is the array used for the dropdown :

    var valueTypes = [
        {'CdCode': 'B', 'DsDescription': 'Descr B' },
        {'CdCode': 'C', 'DsDescription': 'Descr C' }
    ];
    var valueTypesSource =
    {
        datatype: "array",
        datafields: [
            { name: 'CdCode', type: 'string' },
            { name: 'DsDescription', type: 'string' }
        ],
        localdata: valueTypes
    };
    
    var valueTypesAdapter = new $.jqx.dataAdapter(valueTypesSource, {
        autoBind: true
    });

    These the columns declared in the grid for the ValueType combo:

    
    ...
    {
        name: 'ValueType',
        value: 'CdValueType',
        values: { source: valueTypesAdapter.records, value: 'CdCode', name: 'DsDescription' }
    },
    { name: 'CdValueType', type: 'string' }
    ...
    

    and here the declaration of the column for the rendering part:

    
    ...
    {
        text: 'Value type', datafield: 'CdValueType', displayfield:'ValueType', width: 200, columntype: 'dropdownlist',
        createeditor: function (row, value, editor) {
            editor.jqxDropDownList({ source: valueTypesAdapter, displayMember: 'DsDescription', valueMember: 'CdCode' });
        }
    },
    ...

    After a bit of debugging I noticed that the objects retrieved from the server (after the jqx databind) didn’t have the “ValueType” property that should contain the description of “CdValueType” field.
    Note that we decided to overwrote the “loadServerData” in dataadapter calls for the grid binding.

    My impression is that the method “addForeignValues” isn’t called when method “loadServerData” has been overwritten.

    Thanks in advance for your help.
    Best regards
    Giovanni

    Keys/Values column problem #57441

    Peter Stoev
    Keymaster

    Hi Giovanni,

    If that is so, then you know the solution – don’t overwrite the loadServerData method.

    Best Regards,
    Peter Stoev

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

    Keys/Values column problem #103405

    JenkeNg
    Participant

    I have encountered this problem now, but I don’t know the details of solving this problem. who can help me

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

You must be logged in to reply to this topic.