EasyUI Forum
May 14, 2024, 05:59:51 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: 1 ... 236 237 [238] 239
3556  General Category / EasyUI for jQuery / Re: datagrid column title on: July 24, 2011, 06:09:35 PM
var fieldName = 'Name'; // the field name
var opts = $('#tt').datagrid('getColumnOption',fieldName);  // get the specified column option
alert(opts.title);  // the title to display
3557  General Category / EasyUI for jQuery / Re: DataGrid create table get json object on: July 21, 2011, 08:10:52 PM
Use 'formatter' function to format your 'parent' field value. Below is the tutorial:

http://www.jeasyui.com/tutorial/datagrid/datagrid7.php
3558  General Category / EasyUI for jQuery / Re: IE8 Frozen Column(s) on: July 20, 2011, 08:28:24 PM
The 'columns' property is required.
3559  General Category / EasyUI for jQuery / Re: Multiple row in thead on: July 20, 2011, 08:25:11 PM
Here is a tutorial on how to create multiple row head for datagrid.

http://www.jeasyui.com/tutorial/datagrid/datagrid9.php
3560  General Category / EasyUI for jQuery / Re: IE8 Frozen Column(s) on: July 19, 2011, 11:13:34 PM
Please correct your code:

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:

Code:
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
}
3562  General Category / EasyUI for jQuery / Re: Serverside validation and editable datagrid on: July 17, 2011, 06:38:45 PM
The edatagrid plugin is an extension of standard library, see http://www.jeasyui.com/extension/edatagrid.php for more details.
3563  General Category / EasyUI for jQuery / Re: Serverside validation and editable datagrid on: July 15, 2011, 08:10:32 PM
If use 'edatagrid' plugin, add 'onBeforeSave' event is a good idea.

Usage Example:
$('#tt').edatagrid({
  onBeforeSave:function(index){
    // do the row(index) validate
    return false; // return false to prevent editing action
  }
});
3564  General Category / Bug Report / Re: easyui tabs and panel BUG on: July 15, 2011, 02:25:45 AM
Try the below code, set the 'closed' to true to create a hidden panel and the open it.

    $('#tt').tabs('add',{   
      title:title,
      href: url,
      closable:true,
      closed:true,
      cache:true
   });   
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:
Code:
{field:'name',title:'Your Title',width:100,
editor:{
  type:'validatebox',
  options:{
    required:true,
    validType:'url["dovalidate.php","name"]'
  }
}
}
The server side validate logic:
Code:
$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.
Code:
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
  }
});
3567  General Category / Bug Report / Re: $('#a').datagrid('hideColumn','code.promo')‏ on: July 14, 2011, 06:48:59 PM
Change your jQuery version to 1.4.4 or update your datagrid plugin from http://www.jeasyui.com/easyui/plugins/jquery.datagrid.js.
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:

Code:
	<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:

Code:
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
3570  General Category / EasyUI for jQuery / Re: treegrid dynamic load and grid refresh on: July 12, 2011, 12:21:28 AM
Update to the version 1.2.4 and you can simply call 'reload' method, don't need to delete the 'id' property.
Pages: 1 ... 236 237 [238] 239
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!