jQWidgets Forums

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts

  • scottt
    Participant

    For anyone who finds this, and wants to load a drop-down from values inside their data object/array, here is my solution:

    var source =
    {
      localdata: data,
      datatype: "array",
      updaterow: function (rowid, rowdata, commit) {
           commit(true);
      },
      datafields:
      [
        { name: 'status', type: 'string' },
        { name: 'details', type: 'string' },
        { name: 'vendor', type: 'string' },
        { name: 'vendorarr', type: 'string' }
      ]
    };
    
    var dataAdapter = new $.jqx.dataAdapter(source);
    
     
     $("#jqxgrid").jqxGrid(
      {
        width: 1200,
        //height: 210,
        autoheight: true,
        source: dataAdapter,
        columnsresize: false,
        editable: true,
        editmode: 'selectedcell',
        columns: [
          { text: 'Status', datafield: 'status', width: 55, editable: false },
          { text: 'Details', datafield: 'details', width: 350, editable: false },
          { text: 'Vendor', columntype: 'dropdownlist', datafield: 'vendor', width: 125,
                  initeditor: function (row, cellvalue, editor, celltext, cellwidth, cellheight) {
                      editor.jqxDropDownList({ source: dataAdapter.records[row].vendorarr.split(',') });
                  }
          },
        ]
      });
    
Viewing 1 post (of 1 total)