jQuery EasyUI DataGrid autosave
HTML
<h2>Datagrid with Combogrid editor and loadFilter error</h2>
<p>double click on the servername to go in edit mode. Then an error occured on the console, and the datagrid of the combo is empty!
<div class="easyui-panel" style="width:100%; height:400px; padding:12px;">
<table id="dg"></table>
</div>
CSS
</style>
<link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/demo/demo.css">
<script type="text/javascript" src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="http://www.jeasyui.com/easyui/jquery.edatagrid.js"></script>
<script type="text/javascript" src="http://www.jeasyui.com/easyui/datagrid-scrollview.js"></script>
<style>
JavaScript
$(function(){
var dg = $('#dg').edatagrid();
dg.edatagrid({
title:"Test DataGrid",
fit:true,
pagination: true,
singleSelect:true,
striped:true,
rownumbers: true,
fitColumns: true,
data:gridData,
columns:[[
{field:'server', title:'servername', width:200,
editor:{
type:'combogrid',
options:{
prompt: 'Server ...',
rownumbers: true,
singleSelect:true,
autoRowHeight:false,
panelHeight: 140,
view:scrollview,
pageSize: 5,
idField:'value',
textField:'text',
data: data,
columns:[[
{field:'text', title:'Servername', width: 250}
]],
loadFilter: function(data){
//going to the edit mode here comes an error!
console.log('on loadFilter ....');
return data;
}
}
}
},
{field:'comments',title:'Comment',width:240,editor:'text'}
]]
});
});
var gridData = [{
server: 'server 1',
comments: 'testdaten'
}, {
server: 'server 2',
comments: 'testdaten 2'
}, {
server: 'server 3',
comments: 'testdaten 3'
}];
var data = [{
value: '1',
text: 'Server 1'
}, {
value: '2',
text: 'Server 2'
}, {
value: '3',
text: 'Server 3'
}, {
value: '4',
text: 'Server 4'
}, {
value: '5',
text: 'Server 5'
}, {
value: '6',
text: 'Server 6'
}, {
value: '7',
text: 'Server 7'
}, {
value: '8',
text: 'Server 8'
}, {
value: '9',
text: 'Server 9'
}, {
value: '10',
text: 'Server 10'
}, {
value: '11',
text: 'Server 11'
}];