]> git.evergreen-ils.org Git - working/Evergreen.git/commit
Simplify list construction in xul (provide a default map_row_to_columns function...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 11 Nov 2009 08:05:07 +0000 (08:05 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 11 Nov 2009 08:05:07 +0000 (08:05 +0000)
commit52f649d06b5b5ec47fb8706f01e76a0ec06a7b7b
treeaf4f814769b99449205b59a61d20f303cdf32533
parent69eeb132290ba29196861f943a03255c6e302757
Simplify list construction in xul (provide a default map_row_to_columns function), give the option for using fm_IDL.xml for column definitions, and use dojo.date.locale for timestamp columns when using fm_IDL.xml.

Simple example:

Given this XUL:

<tree id="atev_list" flex="1" />

Then this Javascript will build columns based on the "atev" class:

JSAN.use('util.list');
var list = new util.list('atev_list');
list.init(
{
columns: [ 'atev' ]
}
);

If we need to customize certain columns, we could do it like so:

JSAN.use('util.list');
var list = new util.list('atev_list');
list.init(
{
columns: list.fm_columns('atev', {
'atev_id' : { 'primary' : true },
'atev_run_time' : { 'flex' : 1 },
'atev_isdeleted' : { 'hidden' : false, 'onclick' : 'alert("Boo!")' }
})
}
);

git-svn-id: svn://svn.open-ils.org/ILS/trunk@14864 dcc99617-32d9-48b4-a31d-7c20da2025e4
Open-ILS/xul/staff_client/chrome/content/util/list.js