Title: how to make autoconplete in CRUD DataGrid
Post by: htclub on February 27, 2015, 03:38:05 AM
I want to make autoconplete input in CRUD DataGrid how to make?
Title: Re: how to make autoconplete in CRUD DataGrid
Post by: htclub on February 27, 2015, 07:57:08 AM
can you fix my code <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Build CRUD DataGrid with jQuery EasyUI - jQuery EasyUI Demo</title> <link rel="stylesheet" type="text/css" href="css/easyui.css"> <link rel="stylesheet" type="text/css" href="css/icon.css"> <link rel="stylesheet" type="text/css" href="css/demo.css"> <script type="text/javascript" src="js/jquery-1.6.min.js"></script> <script type="text/javascript" src="js/jquery.easyui.min.js"></script> <script type="text/javascript" src="js/jquery.edatagrid.js"></script> </head> <body> <h2>CRUD DataGrid</h2> <p>Double click the row to begin editing.</p> <table id="dg" title="My Users" style="width:100%;height:400" toolbar="#toolbar" pagination="false" idField="id" rownumbers="true" fitColumns="true" singleSelect="true"> <thead> <tr> <th field="firstname" width="50" editor="{type:'validatebox',options:{required:true}}">First Name</th> <th field="lastname" width="50" editor="{type:'validatebox',options:{required:true}}">Last Name</th> <th field="phone" width="50" editor="text">Phone</th> <th field="email" width="50" editor="{type:'validatebox',options:{validType:'number'}}">Email</th> </tr> </thead> </table> <div id="toolbar"> <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="javascript:$('#dg').edatagrid('addRow')">New</a> <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="javascript:$('#dg').edatagrid('destroyRow')">Destroy</a> <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-save" plain="true" onclick="javascript:$('#dg').edatagrid('saveRow')">Save</a> <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-undo" plain="true" onclick="javascript:$('#dg').edatagrid('cancelRow')">Cancel</a> </div> <script type="text/javascript"> $(function(){ $('#dg').edatagrid({ destroyMsg:{ norecord:{ title:'Cảnh baos', msg:'Chưa chonj bản ghi.' }, confirm:{ title:'Xác nhân', msg:'Bạn cos muoons xoá khong?' } }, onBeginEdit: function(rows,r){ $('.datagrid-editable-input').combogrid({ delay: 500, panelWidth:650, mode: 'remote', url: 'datagrid_data1.json', idField: 'productid', textField: 'productname', columns: [[ {field:'productid',title:'Code',width:120,sortable:true}, {field:'productname',title:'Name',width:400,sortable:true} ]] }); }, editIndex: 20, autoSave: true, // auto save the editing row when click out of datagrid url: 't/get_users.php', saveUrl: 't/save_user.php', updateUrl: 't/update_user.php', destroyUrl: 't/destroy_user.php' }); }); </script>
</body> </html>
Title: Re: how to make autoconplete in CRUD DataGrid
Post by: stworthy on February 28, 2015, 12:36:05 AM
Please set the 'combogrid' editor instead of 'text' editor for your column. <th field="phone" width="50" data-options=" editor:{ type:'combogrid', options:{ delay: 500, panelWidth:650, mode: 'remote', url: 'datagrid_data1.json', idField: 'productid', textField: 'productname', columns: [[ {field:'productid',title:'Code',width:120,sortable:true}, {field:'productname',title:'Name',width:400,sortable:true} ]] } } ">Phone</th>
|