[Dojo-interest] DOJO dgrid

vijaybadugu vijay.badugu at wipro.com
Fri Jan 31 05:36:23 EST 2014


hi all,

I have created dojo dgrid and binding CSV file contents using browse control
with editing option enabled.first time its working fine and editing
perfectly. when second file loaded, its editing fine but all events are
firing 2 time if 3 rd file loaded, 3 times . and one more thing data changed
in second time loaded file going to first time loaded column value. please
suggest on this.


code :

 var cols = []
                    for (var i = 0; i < keys.length; i++) {

                     if (i==0)
{
                        cols[i] = {
                            field: keys[i]};
}
else
{
 		cols[i] =  new editor({
                            field: keys[i],
                          
                            editOn: "dblclick",
                            editor: "textbox"
                        });
}

                    }
                  
                   document.getElementById('grid').innerHTML = "";
					
					
                  // Creating memory object to store CSV contents
                    var store = new dojo.store.Memory({
                        data: data1,
				idProperty : keys[0]
                        
                    });
 //alert(JSON.stringify(store));
//alert(JSON.stringify(cols));
var SelectionGrid = declare([OnDemandGrid,Grid, Selection, Keyboard]);
					
				 // Binding  memory store dojo dgrid

                   var grid = new OnDemandGrid({                 
                       
                      

                    }, "grid");
					
					 grid.set("columns", cols);
 grid.set("store",[]);
					 grid.set("store",store);


grid.on("dgrid-datachange", function(evt){
						
						alert("cell: " + evt.cell.row.id + " " + evt.cell.column.field);
					});
                  grid.on("dgrid-error", function(evt) {
					alert("error on grid: " +  evt.error);
				});



--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/DOJO-dgrid-tp4000920.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.


More information about the Dojo-interest mailing list