3560
|
General Category / EasyUI for jQuery / Re: IE8 Frozen Column(s)
|
on: July 19, 2011, 11:13:34 PM
|
Please correct your code: <script type="text/javascript"> $(document).ready(function() { $('.gridview').datagrid({ title: 'Frozen Columns', height: 300, frozenColumns: [[ { field: 'itemid', title: 'Item ID', width: 80 }, { field: 'productid', title: 'Product ID', width: 80 } ]], columns:[[ {field:'code',title:'Code',width:100}, {field:'name',title:'Name',width:100}, {field:'price',title:'Price',width:100,align:'right'} ]] }); }); </script>
|
|
|
3561
|
General Category / EasyUI for jQuery / Re: Serverside validation and editable datagrid
|
on: July 19, 2011, 12:16:29 AM
|
Call 'endEdit' method will finish editing action and the row data will be posted to server. In this case, you can get all the editing field value and do some validation: onBeforeSave:function(index){ var nameEditor = $('#tt').edatagrid('getEditor',{index:index,field:'name'}); var countryEditor = $('#tt').edatagrid('getEditor',{index:index,field:'country'}); var nameValue = $(nameEditor.target).val(); // get name field value var countryValue = $(countryEditor.target).combobox('getValue'); // get country field value, notice that the editor type is combobox // do validation about name and country field return false; // valiate failure }
|
|
|
3565
|
General Category / Bug Report / Re: easyui tabs and panel BUG
|
on: July 15, 2011, 12:04:03 AM
|
For the first question, set 'cache' property to true to prevent reload page when select tab panel.
For the second question, when create panel with 'href' property, the remote page content will be loaded. $('#p').panel({ title: 'My Panel', href: xxxx.jsp }); The code above will create a panel and send a remote request to load content. Call 'refresh' will reload the panel content again, so a content page request will be sent to remote server again.
|
|
|
3566
|
General Category / EasyUI for jQuery / Re: Serverside validation and editable datagrid
|
on: July 14, 2011, 07:44:58 PM
|
Use the remote validatebox to do server side validation, the code looks like this: {field:'name',title:'Your Title',width:100, editor:{ type:'validatebox', options:{ required:true, validType:'url["dovalidate.php","name"]' } } }
The server side validate logic: $name = $_REQUEST['name']; //your validate code here echo 'true'; // return true if validate successfully
Another way to do remote validation is to validate before end your editing. var ed = $('#tt').datagrid('getEditor',{index:2,field:'name'}); // get the editor var v = $(ed.target).val(); // get the field value // do validate now $.post('...',{name:v},function(result){ if (result.success){ $('#tt').datagrid('endEdit',2); // end editing } });
|
|
|
3568
|
General Category / EasyUI for jQuery / Re: js error -------> message: 'nodeName' is null or not object
|
on: July 13, 2011, 12:06:20 AM
|
The page(datagrid.html) to be loaded cannot contain a body tag. Try the page code below: <table id="tt"></table> <script> $(function(){ $('#tt').datagrid({ url: 'datagrid_data.json', title: 'DataGrid - ContextMenu', width: 600, height: 300, fitColumns: true, columns:[[ {field:'itemid',title:"Item ID11s",width:80}, {field:'productid',title:'Product ID',width:100}, {field:'listprice',title:'List Price',width:80,align:'right'}, {field:'unitcost',title:'Unit Cost',width:80,align:'right'}, {field:'attr1',title:'Attribute',width:150}, {field:'status',title:'Status',width:60,align:'center'} ]] }); }); </script>
|
|
|
3569
|
General Category / EasyUI for jQuery / Re: Grids within Tabs with the same ID
|
on: July 12, 2011, 06:59:49 PM
|
Only one element may has a particular id. If two or more elements share the same id, then you cannot find the exactly element by id. A better way is to set the class attribute to every grid, at later you can use the class selector to find them, just like this: <table class="mytable easyui-datagrid"></table> If you want to do some actions with the grid that displayed in selected tab panel, get the selected tab panel first and then find that grid: var p = $('#tt').tabs('getSelected'); // get the selected tab panel var g = p.find('table.mytable'); // get datagrid object g.datagrid('reload'); // call datagrid method
|
|
|
|