[open-ils-commits] r11617 - in trunk/Open-ILS/web: js/ui/default/conify/global/config templates/default/conify/global/config

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Dec 17 16:39:40 EST 2008


Author: erickson
Date: 2008-12-17 16:39:35 -0500 (Wed, 17 Dec 2008)
New Revision: 11617

Modified:
   trunk/Open-ILS/web/js/ui/default/conify/global/config/circ_modifier.js
   trunk/Open-ILS/web/templates/default/conify/global/config/circ_modifier.tt2
Log:
added basic infrastructure for inline cell editing.  now we just need widgets

Modified: trunk/Open-ILS/web/js/ui/default/conify/global/config/circ_modifier.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/conify/global/config/circ_modifier.js	2008-12-17 21:29:08 UTC (rev 11616)
+++ trunk/Open-ILS/web/js/ui/default/conify/global/config/circ_modifier.js	2008-12-17 21:39:35 UTC (rev 11617)
@@ -10,6 +10,7 @@
     var store = new dojo.data.ItemFileWriteStore({data:ccm.initStoreData('code', {identifier:'code'})})
     cmGrid.setStore(store);
     cmGrid.render();
+    dojo.connect(store, 'onSet', cmGridChanged);
 
     fieldmapper.standardRequest(
         ['open-ils.permacrud', 'open-ils.permacrud.search.ccm'],
@@ -25,6 +26,18 @@
     );
 }
 
+function cmGridChanged(item, attr, oldVal, newVal) {
+    var cm = cmCache[cmGrid.store.getValue(item, 'code')];
+    console.log("changing cm " + cm.code() + " object: " + attr + " = " + newVal);
+    cm[attr](newVal);
+    cm.ischanged(true);
+    cmSaveButton.setDisabled(false);
+}
+
+function saveChanges() {
+    /* loop through the changed objects in cmCache and update them in the DB */
+}
+
 function getMagneticMedia(rowIdx, item) {
     if(!item) return '';
     var magMed = this.grid.store.getValue(item, this.field);

Modified: trunk/Open-ILS/web/templates/default/conify/global/config/circ_modifier.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/conify/global/config/circ_modifier.tt2	2008-12-17 21:29:08 UTC (rev 11616)
+++ trunk/Open-ILS/web/templates/default/conify/global/config/circ_modifier.tt2	2008-12-17 21:39:35 UTC (rev 11617)
@@ -51,6 +51,7 @@
     </div> 
 
     <button dojoType='dijit.form.Button' onclick='deleteFromGrid();'>Delete Selected</button>
+    <button dojoType='dijit.form.Button' onclick='saveChanges();' disabled='disabled' jsId='cmSaveButton'>Save Changes</button>
 
     <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:600px;'>
         <table jsId="cmGrid" dojoType="dojox.grid.DataGrid" query="{name: '*'}" rowSelector='20px'>



More information about the open-ils-commits mailing list