大家好,我是easyui 菜鸟
我想请问下easyui combogrid如何设置选中的值啊
主要的问题是
TypeError: $(...).combogrid is not a function
这样让只能用css的模式来创建combogrid
但是我要设置它选中的值,用css模式就不行了
$(function () {
$('#sh_tonnage').combogrid('setValue','002');
})
我都是按照官方来的,不知道怎么回事
我用的asp.net +easyui。
我想知道的是有没有办法其他办法设置他css模式下data-options下的json的属性啊
请指教
------解决方案--------------------
加个扩展:
$.extend($.fn.datagrid.defaults.editors, {
combogrid: {
init: function (container, options) {
var input = $('<input type="text" class="datagrid-editable-input">').appendTo(container);
input.combogrid(options);
return input;
},
destroy: function (target) {
$(target).combogrid('destroy');
},
getValue: function (target) {
return $(target).combogrid('getValue');
},
setValue: function (target, value) {
$(target).combogrid('setValue', value);
},
resize: function (target, width) {
$(target).combogrid('resize', width);
}
}
});