EasyUI Forum
May 18, 2024, 11:06:40 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Combogrid from markup  (Read 10091 times)
mazvv
Newbie
*
Posts: 20


View Profile WWW
« on: January 02, 2014, 11:37:20 AM »

Is it possible to make combogrid from markup? For example I have a datagrid:
Code:
        <table class="easyui-datagrid"
            tal:attributes="url url; id id_datagrid"
            data-options="
                border:false,pagination:true,fit:true,pageSize:50,singleSelect:true,
                rownumbers:true,sortName:'rid',sortOrder:'desc',
                pageList:[50,100,500],idField:'_rid',checkOnSelect:false,
                selectOnCheck:false,toolbar:'#${id_datagrid_toolbar}'
            "
            width="100%">
            <thead>
                <tr>
                    <th data-options="field:'_rid',checkbox:true" i18n:translate="">rid</th>
                    <th data-options="field:'rid',sortable:true,width:60" i18n:translate="">rid</th>
                    <metal:block metal:define-slot="fields">
                    </metal:block>
                    <th data-options="field:'status',width:50,formatter:function(value,row,index){return datagrid_resource_status_format(value);},styler:function(){return datagrid_resource_cell_styler();}"><strong i18n:translate="">status</strong></th>
                    <th data-options="field:'modifydt',sortable:true,width:120,styler:function(){return datagrid_resource_cell_styler();}"><strong i18n:translate="">updated</strong></th>
                    <th data-options="field:'owner',width:100,styler:function(){return datagrid_resource_cell_styler();}"><strong i18n:translate="">owner</strong></th>
                </tr>
            </thead>
        </table>
and I want to make combogrid from it
Thanks
Logged

TravelCRM - opensource CRM for travel companies
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: January 03, 2014, 12:09:34 AM »

Try this.
Code:
	<input id="cg" class="easyui-combogrid" style="width:250px" data-options="
panelWidth: 500,
idField: 'itemid',
textField: 'productname',
data:data,
multiple:true,
columns: [[
{field:'ck',checkbox:true},
{field:'itemid',title:'Item ID',width:80},
{field:'productname',title:'Product',width:120},
{field:'listprice',title:'List Price',width:80,align:'right'},
{field:'unitcost',title:'Unit Cost',width:80,align:'right'},
{field:'attr1',title:'Attribute',width:200},
{field:'status',title:'Status',width:60,align:'center'}
]],
fitColumns: true
">
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!