EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: zolotoy on June 20, 2015, 12:22:57 PM



Title: Define components in code
Post by: zolotoy on June 20, 2015, 12:22:57 PM
Can we instantiate components like datagrid in the code?

Thanks


Title: Re: Define components in code
Post by: stworthy on June 21, 2015, 01:19:55 AM
You can create a datagrid using javascript code.
Code:
$('#dg').datagrid({
    url:'datagrid_data.json',
    columns:[[
        {field:'code',title:'Code',width:100},
        {field:'name',title:'Name',width:100},
        {field:'price',title:'Price',width:100,align:'right'}
    ]]
});

For more information please refer to http://www.jeasyui.com/documentation/datagrid.php