[open-ils-commits] r9189 -
branches/dojo-admin/Open-ILS/web/conify/global/permission
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Apr 2 09:33:18 EDT 2008
Author: miker
Date: 2008-04-02 08:57:00 -0400 (Wed, 02 Apr 2008)
New Revision: 9189
Modified:
branches/dojo-admin/Open-ILS/web/conify/global/permission/grp_tree.html
Log:
getting much closer to group perm editing
Modified: branches/dojo-admin/Open-ILS/web/conify/global/permission/grp_tree.html
===================================================================
--- branches/dojo-admin/Open-ILS/web/conify/global/permission/grp_tree.html 2008-04-02 02:16:11 UTC (rev 9188)
+++ branches/dojo-admin/Open-ILS/web/conify/global/permission/grp_tree.html 2008-04-02 12:57:00 UTC (rev 9189)
@@ -172,7 +172,6 @@
perm_map_model.query = { grp : current_group ? current_group.id[0] : -1 };
perm_map_model.refresh();
- perm_grid.refresh();
highlighter.editor_pane.green.play();
status_update( 'Now editing ' + this.store.getValue( item, 'name' ) );
@@ -465,14 +464,28 @@
</div>
<div id="perm_pane" dojoType="dijit.layout.ContentPane" title="Group Permissions">
+ <script type="dojo/connect" event="onShow">
+ perm_grid.refresh();
+ </script>
<div id="grid_container" dojoType="dijit.layout.ContentPane">
<div dojoType="dojox.grid.data.DojoData" id="perm_map_model"jsId="perm_map_model" store="perm_map_store">
<script type="dojo/connect" event="startup">
- function get_item_part(model_field, item_search_field, item_part, model, store, row) {
+ function get_item_part(model_field, item_search_field, item_part, model, store, datum, row) {
+ var formatter = true;
+
+ if (!row && row != '0') {
+ row = datum;
+ formatter = false;
+ }
+
if(!model.getRow(row)) return null;
var value = null;
+ if(!formatter) { //this.editor && (this.editor.alwaysOn || (this.grid.edit.info.rowIndex==row && this.grid.edit.info.cell==this))) {
+ return model.getRow(row)[model_field];
+ }
+
var q = {};
q[item_search_field] = model.getRow(row)[model_field];
@@ -489,26 +502,24 @@
[
{ name : "Code",
field: "perm",
- get : dojo.partial(get_item_part, "perm", "id", "code", perm_map_model, perm_store),
+ formatter : dojo.partial(get_item_part, "perm", "id", "code", perm_map_model, perm_store),
width : "300px"
},
{ name : "Depth",
field : "depth",
- get : dojo.partial(get_item_part, "depth", "depth", "name", perm_map_model, ou_type_store),
- editor : dojox.grid.editors.ComboBox,
+ formatter : dojo.partial(get_item_part, "depth", "depth", "name", perm_map_model, ou_type_store),
+ editor : dojox.grid.editors.select,
options : dojo.map( _ou_type_list, function (x) { return x.name() } ),
values : dojo.map( _ou_type_list, function (x) { return x.depth() } )
},
{ name : "Grantable",
+ field : "grantable",
+ editor : dojox.grid.editors.bool,
get : function (row) {
- var curr = perm_map_model.getRow(row);
- if (!curr || curr.grantable == 'f') return "No";
- return "Yes";
+ var gr = get_item_part("id", "id", "grantable", perm_map_model, perm_map_model.store, row, row);
+ if (gr == 't' || gr === true) return true;
+ return false;
},
- field : "grantable",
- editor : dojox.grid.editors.ComboBox,
- options : [ "Yes","No" ],
- value : ['t','f']
}
]
]
More information about the open-ils-commits
mailing list