jqwidgets の Jqxgrid を使用しています。
グリッドでドロップダウン リストを取得しました。
ページの読み込み時にデフォルトで編集可能モードでドロップダウン リストを表示したい。
最初のドロップダウンが「選択してください」と表示されているこのスクリーンショットを見てください。グリッドセルをクリックすると、デフォルトをバインドする方法が表示されます。
以下はコードです。
{
text: 'Position of meter in Rack', datafield: 'MeterPositionInRack', width: 180, columntype: 'dropdownlist', editable: true,
createeditor: function (row, column, editor) {
var list = ['1', '2', '3' ,'4'];
editor.jqxDropDownList({ autoDropDownHeight: true, source: list, selectedIndex: 0 });
editor.jqxDropDownList.bind('select', function (event) {
var args = event.args;
var item = $('#jqxdropdownlist').jqxDropDownList('getItem', args.index);
alert('Selected: ' + item.label);
});
}
, initeditor: function (row, cellvalue, editor) {
var list1 = ['1', '2', '3', '4'];
console.log("initeditor: " + list1);
editor.jqxDropDownList({ autoDropDownHeight: true, source: list1, selectedIndex: 0 });
}
}
私を助けてください。