Hungry for grid docs - Ext JS

本文探讨了ExtJS中Grid组件的使用方法,特别是ArrayReader的配置细节,包括字段类型选项如string、int、float等,以及其他配置项如defaultValue、mapping等。同时讨论了如何设置RowSelectionModel以实现单行选择的功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

I have a hard time figuring out how to use undocumented classes, and grid requires many classes- few of them with any formal documentation. OK it's alpha and it's to be expected!

Specifically, my data is in an array, has the first column as a numeric ID which should be hidden. I'm reading the source and have figured out that in this portion:

new Ext.data.ArrayReader({id: 0}, [  {name: 'my_id', type: ...},
the "{id: 0}" says that the row id is in column 0. The second part has one object per column with its attributes.

My real question --> What are the choices for "type"? What are the other config options? <--

The ID should stay hidden. I figure that's a config option in Ext.grid.ColumnModel called "hidden", found it in the source. Semi-rhetorical question: why are the grid source files divided into two directories, source/grid and source/widgets/grid?

I suppose none of this is all that important, I'll slog though it now, and later the docs will be done and it won't be an issue.
Reply With Quote
  #2  
Old 03-08-2007, 01:43 AM
Default

To answer my own q (more or less):
the "types" of a field are defined in source/data/DataField.js

not specifying a type will set it to auto and uses the field as-is

valid values for type are:
  • string
    int
    float
    bool (or boolean)
    date (if given, can also specify dateFormat)

Some other config options are:
  • defaultValue
    mapping
    sortType
    sortDir (defaults to ASC)
I haven't investigated the source further, now that I have the info I'm looking for.
Reply With Quote
  #3  
Old 03-08-2007, 02:25 AM
Default

Next grid-related question, does RowSelectionModel have a config option to specify only one row selected at a time, disabling shift-click/drag/etc? My quick look through the source tells me "no".
Reply With Quote
  #4  
Old 03-08-2007, 03:02 AM
Default

Quote:
Originally Posted by fecund
Next grid-related question, does RowSelectionModel have a config option to specify only one row selected at a time, disabling shift-click/drag/etc? My quick look through the source tells me "no".
var grid = new Ext.grid.Grid('grid', {
	ds : ds,
	cm : cm,
	selModel : new Ext.grid.RowSelectionModel({ singleSelect : true})
}
Reply With Quote
  #5  
Old 03-08-2007, 03:07 AM
DefaultRe: Hungry for grid docs

Quote:
Originally Posted by fecund
My real question --> What are the choices for "type"? What are the other config options? <--
Try opening source/data/DataField.js and look through lines 43-61 :wink:
Reply With Quote
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值