This site has JQuery, Ext/Sencha Plugins, such as: Grid Combobox Tree Tabs
Please use IE7+, FireFox, Chrome
MagicGrid is a small and flexible JQuery grid plugin.
Although it only provide basic grid function, good design model give it great flexibility.
Basic features:
- adjust row width
- change row order by drag and drop
- load data from local and remote
- row definition by youself (Render)
- succinct code (size of origin code is under 10k, after compress it is under 3k), update easily.
- easy study and use
- easy custom css style
Just a little more code, you can implement the following functions:
- multiple-row header (at present it provides two-row header)
- order by local or server
- pagination by local and remote
- define the pagination css style by yourself
- row summation
- row extend
- the first row can be locked
Sort data at local or server. default = false.
- true: sort grid data (current page) via js.
- false: just post request params to loadUrl.
Height of grid header set. It is important if you want use multi headers.
demo
Height of grid footer if you have.
demo
A array of columns set.
Items |
Description |
Note |
field |
property of record data object |
optional |
title |
column title, it also can be a JS or JQuery element |
optional, demo |
width |
column width |
must be assigned, unit is px |
header |
JS or JQuery element for custom head |
optional, but it is important for multi headers.demo |
sizeable |
If this column can be resize width |
optional, default = true |
render |
a function that return a JS or JQuery element to show in cells. |
optional.demo |
|
1. r: record object
2. tr: row element
3. gd: grid element
|
|
- url: URL, data provider
- params: load params, eg: { pageNo: 1, pageSize: 20 }
- autoLoad: whether auto load data when current page ready. default = true
how many page numbers will show in the page bar. optional.
but, if you do not assign this value, the page bar will be hidden.
This event will be trigged since data be loaded to grid.
- dd: direct grid data array.demo
- po: full grid data object with pagenation. demo
Sort by current sorter elements or assigned sorter element.
- el: sorter element, optional, usually not use
Manually fit the grid to the container of it or just fit to itself.
- vp: container(viewPort) of it, optional
Create a new row but do not append it to grid.
Return element(tr) of new row.
- r: data object of this row
- k: manually assigne the key of row. It must be passed when option "key" is not set.
Here is an
demo.
Create and append a new row to grid.
Same param with "newRow" method.
Load data to grid from local memory.
- dd: direct grid data array.demo
- po: full grid data object with pagenation. this param will be passed to afterLoad event.demo
Load data to grid from remote url(option loadUrl).
- pm: params for load. eg: { name: 'tom' }
Freeze first one or seriate more columns from left.
- cs: name array of columns, eg: ['code','name']
Copyright © 2011. All rights reserved 蜀ICP备11014774号-1
QQ: 7213571 MSN: pyh_jerry@163.com E-mail: pyh_jerry@163.com