[open-ils-commits] r11474 - in trunk/Open-ILS/web: js/ui/default/acq/picklist templates/default/acq/picklist
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Dec 9 11:10:42 EST 2008
Author: erickson
Date: 2008-12-09 11:10:40 -0500 (Tue, 09 Dec 2008)
New Revision: 11474
Modified:
trunk/Open-ILS/web/js/ui/default/acq/picklist/view_list.js
trunk/Open-ILS/web/templates/default/acq/picklist/list.tt2
Log:
moved picklist grid to new-style (dojo 1.2) markup grid
Modified: trunk/Open-ILS/web/js/ui/default/acq/picklist/view_list.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/picklist/view_list.js 2008-12-09 13:50:01 UTC (rev 11473)
+++ trunk/Open-ILS/web/js/ui/default/acq/picklist/view_list.js 2008-12-09 16:10:40 UTC (rev 11474)
@@ -1,4 +1,4 @@
-dojo.require('dojox.grid.Grid');
+dojo.require('dojox.grid.DataGrid');
dojo.require('dijit.Dialog');
dojo.require('dijit.form.Button');
dojo.require('dijit.form.TextBox');
@@ -11,10 +11,8 @@
function makeGridFromList() {
var store = new dojo.data.ItemFileReadStore({data:acqpl.toStoreData(plList)});
- var model = new dojox.grid.data.DojoData(null, store,
- {rowsPerPage: 20, clientSort: true, query:{id:'*'}});
- plListGrid.setModel(model);
- plListGrid.update();
+ plListGrid.setStore(store);
+ plListGrid.render();
}
Modified: trunk/Open-ILS/web/templates/default/acq/picklist/list.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/acq/picklist/list.tt2 2008-12-09 13:50:01 UTC (rev 11473)
+++ trunk/Open-ILS/web/templates/default/acq/picklist/list.tt2 2008-12-09 16:10:40 UTC (rev 11474)
@@ -45,22 +45,28 @@
<script>
- function getName(rowIndex) {
- data = plListGrid.model.getRow(rowIndex);
- if(!data) return;
- return '<a href="[% ctx.base_uri %]/acq/picklist/view/'+data.id+'">'+data.name+'</a>';
+ function getName(rowIndex, item) {
+ if(!item) return '';
+ var name = this.grid.store.getValue(item, 'name');
+ var id = this.grid.store.getValue(item, 'id');
+ return '<a href="[% ctx.base_uri %]/acq/picklist/view/'+id+'">'+name+'</a>';
}
+</script>
+<div dojoType="dijit.layout.ContentPane" layoutAlign="top">
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:600px;'>
+ <table jsId="plListGrid" dojoType="dojox.grid.DataGrid" query="{id: '*'}" rowSelector='20px'>
+ <thead>
+ <tr>
+ <th field="id">ID</th>
+ <th field="name" width='auto' get='getName'>Name</th>
+ <th field="owner">Selector</th>
+ <th field="create_time">Create Time</th>
+ <th field="edit_time">Edit Time</th>
+ <th field="entry_count">Entry Count</th>
+ </tr>
+ </thead>
+ </table>
+ </div>
+</div>
- var plListGridStructure = [{
- cells : [[
- {name: 'ID', field: 'id'},
- {name: 'Name', width:'auto', get:getName},
- {name: 'Selector', field:'owner'},
- {name: 'Create Time', field: 'create_time'},
- {name: 'Edit Time', field: 'edit_time'},
- {name: 'Entry Count', field: 'entry_count'},
- ]]
- }];
-</script>
-<div jsId='plListGrid' dojoType="dojox.Grid" structure='plListGridStructure'></div>
[% END %]
More information about the open-ils-commits
mailing list