jQuery EasyUI Data Grid -Создание групп столбцов
Таблица данных (DataGrid) easyui может создавать группы столбцов, как показано ниже:
В этом примере мы используем плоские данные для заполнения таблицы данных (DataGrid) и объединяем столбцы listprice, unitcost, addr1 и status в один столбец.
Чтобы создать группы столбцов, необходимо определить данные columns плагина таблицы данных (datagrid). Каждый элемент columns определяет группу ячеек, которые можно объединить с помощью атрибутов rowspan или colspan.
Следующий код реализует приведённый выше пример:
<table id="tt" title="Column Group" class="easyui-datagrid" style="width:550px;height:250px" url="data/datagrid_data.json" singleSelect="true" iconCls="icon-save" rownumbers="true"> <thead> <tr> <th rowspan="2" field="itemid" width="80">Item ID</th> <th rowspan="2" field="productid" width="80">Product ID</th> <th colspan="4">Item Details</th> </tr> <tr> <th field="listprice" width="80" align="right">List Price</th> <th field="unitcost" width="80" align="right">Unit Cost</th> <th field="attr1" width="100">Attribute</th> <th field="status" width="60" align="center">Stauts</th> </tr> </thead> </table>
Скачать примеры jQuery EasyUI
jeasyui-datagrid-datagrid9.zip
Другие расширения