EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: bakkers on June 18, 2015, 06:40:37 AM



Title: Treegrid with checkbox selection
Post by: bakkers on June 18, 2015, 06:40:37 AM
Hello

Is there a way to add checkbox selection to a treegrid?

If it's not posible can i the make treegrid with the option to select multiple lines?


Title: Re: Treegrid with checkbox selection
Post by: jarry on June 18, 2015, 11:51:09 PM
Please add a 'checkbox' column to get a checkbox selecting treegrid.
Code:
<table id="tg" title="Folder Browser" class="easyui-treegrid" style="width:700px;height:250px"
data-options="
url: 'treegrid_data1.json',
method: 'get',
rownumbers: true,
idField: 'id',
treeField: 'name',
singleSelect: false
">
<thead>
<tr>
<th data-options="field:'ck',checkbox:true"></th>
<th data-options="field:'name'" width="220">Name</th>
<th data-options="field:'size'" width="100" align="right">Size</th>
<th data-options="field:'date'" width="150">Modified Date</th>
</tr>
</thead>
</table>


Title: Re: Treegrid with checkbox selection
Post by: Aod47 on June 20, 2015, 06:14:34 AM
Could you please show me how to set cascadeCheck like a [CheckBox Tree] and how to get value from selected rows. Many thank.


Title: Re: Treegrid with checkbox selection
Post by: jarry on June 20, 2015, 04:57:02 PM
The cascade checking feature does not supported in the treegrid plugin.


Title: Re: Treegrid with checkbox selection
Post by: bakkers on June 22, 2015, 12:29:40 AM
Please add a 'checkbox' column to get a checkbox selecting treegrid.
Code:
<table id="tg" title="Folder Browser" class="easyui-treegrid" style="width:700px;height:250px"
data-options="
url: 'treegrid_data1.json',
method: 'get',
rownumbers: true,
idField: 'id',
treeField: 'name',
singleSelect: false
">
<thead>
<tr>
<th data-options="field:'ck',checkbox:true"></th>
<th data-options="field:'name'" width="220">Name</th>
<th data-options="field:'size'" width="100" align="right">Size</th>
<th data-options="field:'date'" width="150">Modified Date</th>
</tr>
</thead>
</table>

Thank you for this, is there anyway to make it so the user can select more the one checkbox?


Title: Re: Treegrid with checkbox selection
Post by: jarry on June 22, 2015, 01:42:12 AM
The singleSelect has been set to false, so you can select multiple rows on the treegrid.