jQWidgets Forums

jQuery UI Widgets Forums Grid Knockout and lookup field

This topic contains 0 replies, has 1 voice, and was last updated by  xaviergxf 10 years, 10 months ago.

Viewing 1 post (of 1 total)
  • Author
  • Knockout and lookup field #61112

    xaviergxf
    Participant

    Hi,

    i’m having a problem with knockout and a displayField.
    The error is at the setcellvalue when it does the following: if(E!=null&&E.label!=null){r[h.displayfield](E.label);
    The displayField is not a real property in my object, so r[h.displayfield] is undefined. Here’s a piece of my source code:

    var ViewModelType = function (items) {
    var self = this;
    ko.mapping.fromJS(items, {child: {
    create: function(options) {
    return new ViewModelType(options.data);
    }
    }}, self);
    };
    var Model = {…};
    var ViewModel = new ViewModelType(Model);

    var StartupType = new $.jqx.dataAdapter({datatype: ‘json’, mapChar: ‘.’, async: false, id:’value’, datafields:[{name: ‘value’, type:’number’}, {name: ‘label’, type: ‘string’}], localdata: [{“value”:1,”label”:”AUTOMATIC”},{“value”:0,”label”:”MANUAL”}]},

    var source = { type: ‘POST’,
    datatype: ‘observablearray’,
    mapChar: ‘.’,
    datafields: [{name:’StartupTypedisp’, value: ‘StartupType’, values: { source: StartupType.records, value:’value’, name:’label’}},],

    };
    // initialize jqxGrid
    $(‘#b2efb558-1135-4691-904a-f6e207a4d90f’).jqxGrid({

    columns: [{text: ‘StartupType’, displayfield:’StartupTypedisp’, columntype: ‘dropdownlist’, initeditor: function (row, value, editor) {
    editor.jqxDropDownList({ source: StartupType, displayMember: ‘label’, valueMember: ‘value’ });
    }, datafield:’StartupType’ }]

    Can i observe the real value behind the dropdown value? How can i get through this problem?

    Thanks a lot

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.