Setting the value of textfield on combobox change- easyui -
below part of rows. need alter value of budgetlineitemcode field when combobox value changed.
{ title: 'index', field: 'rootlevel', width: 50, editor: { 'type': 'validatebox', 'options': { required: true}} }, { field: 'pheading', title: 'heading', width: 240, formatter: function (value) { (var = 0; < citems.length; i++) { if (citems[i].heading.tolowercase() == value.tolowercase()) { homecoming citems[i].heading; } homecoming value; }, editor: { type: 'combobox', options: { valuefield: 'heading', textfield: 'heading', data: citems, required: true onselect: function (record) { var selrow = $('#trgrid').treegrid('getselected'); var rowindex = $('#trgrid').treegrid('find',row.budgetdetailid) var editors =$('#trgrid').treegrid('geteditors',selrow.budgetdetailid); var codeeditor = editors[2]; $(codeeditor.target).text('setvalue', 'newval'); } } }{ title: 'code', field: 'budgetlineitemcode', width: 50, editor: { 'type': 'text'} }
also, 1 more question. there no onchange event combobox. there way can past this. mean may want check code user types in combobox.
for first part can do
$(codeeditor.target).val('newval');
since setters validatebox .val(),
docs here..
and sec easyui combobox default.. or can utilize keyhandler
editor: { type: 'combobox', options: { valuefield: 'heading', textfield: 'heading', data: citems, required: true, keyhandler: { up: function(){}, down: function(){}, enter: function(){}, query: function(q){ console.log(q)} //<----here }, onselect: function (record) { var selrow = $('#trgrid').treegrid('getselected'); var rowindex = $('#trgrid').treegrid('find',row.budgetdetailid) var editors =$('#trgrid').treegrid('geteditors',selrow.budgetdetailid); var codeeditor = editors[2]; $(codeeditor.target).text('setvalue', 'newval'); } }
jquery-easyui
No comments:
Post a Comment