首页 > Web开发 > 详细

DHTMLX 前端框架 建立你的一个应用程序 教程(五)--添加一个表格Grid

时间:2014-10-18 00:35:35      阅读:358      评论:0      收藏:0      [点我收藏+]

 

表格例子

 

  样本如下:

  bubuko.com,布布扣

  我们这篇介绍的是dhtmlxGrid  组件。 它支持4种数据格式:XML, JSON, CSV, JSArray.

 

添加表格到布局的单元格中去:

  

  1.使用attachGrid() 方法将表格添加到布局的单元格中去。

  

 var layout = new dhtmlXLayoutObject(document.body,"2U");
 var contactsGrid = layout.cells("a").attachGrid();

 

  2.继续添加代码 进行gird的初始化设置:

  

contactsGrid.setHeader("Name,Last Name,Email");   //sets the headers of columns
contactsGrid.setColumnIds("fname,lname,email");         //sets the columns‘ ids
contactsGrid.setInitWidths("250,250,*");   //sets the initial widths of columns
contactsGrid.setColAlign("left,left,left");     //sets the alignment of columns
contactsGrid.setColTypes("ro,ro,ro");               //sets the types of columns
contactsGrid.setColSorting("str,str,str");  //sets the sorting types of columns

 

  3.用init() 方法进行表格的初始化

  

contactsGrid.init();

 

  bubuko.com,布布扣

DHTMLX 前端框架 建立你的一个应用程序 教程(五)--添加一个表格Grid

原文:http://www.cnblogs.com/DemoLee/p/4032272.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!