PDA

View Full Version : Repeated records in tree grid



super.rotus
9 May 2014, 9:24 AM
Hi everyone, I have a problem with a grid (treegrid)My tree grid is working ok, but if you start to refresh the search of the tree grid, after n times (i cant determine a patron)the records duplicates, and if you try to select the repeated record you cant, is like it doesnt exist for the grid, you only can choose the other record,here is my code, and here is a pic of the incidence. regards.
grid.setRootNode(null); grid.getView().refresh() ; grid.setLoading(true, true); fin=inicio+pageSize; var storeGrid=Ext.create('store.PackageTrackingGrid'); var storeDock=Ext.create('store.PackageTrackingDock'); //if(idService.value!=null){ storeGrid.getProxy().extraParams = { 'idService':idServiceStr, 'operationType':tipoOpStr, 'status':estatusStr, 'date':fecha.value, 'start':0, 'limit':26, 'tamanoPagina':''}; storeGrid.load({ params: { }, callback: function(records, operation, success) { if(records.length==0){ Ext.Msg.alert('Bus de Tr\u00E1mites','No se encuentran campos con esos par\u00E1metros de b\u00FAsqueda'); grid.setRootNode(null); grid.getView().refresh() ; grid.setRootNode(storeGrid.getRootNode()); grid.getView().refresh() ; storeDock.getProxy().extraParams = { 'numeroElementos':0 }; storeDock.load({ params:{ numeroElementos:0 }, callback: function(records, operation, success) { storeDock.totalCount =totalCampos; toolb.bindStore( storeDock ,true); toolb.onLoad( ); grid.setLoading(false); }}); }else{ limpiarSegPaq=true; grid.setRootNode(null); grid.getView().refresh() ; grid.setRootNode(storeGrid.getRootNode()); var totalCampos=grid.getRootNode().getChildAt (0).get('rowCount'); tamanoTotal=parseInt(totalCampos); storeDock.getProxy().extraParams = { 'numeroElementos':tamanoTotal };

scottmartin
9 May 2014, 12:38 PM
Seems like you are duplicating your record / id .. make sure this is not happening. Check your store.

Also .. not sure I understand your nested load / refresh / refresh / load, etc

Looks like a recipe for problems.

super.rotus
9 May 2014, 1:43 PM
Hey scott... uhm, is not duplicated because is only 1 record what is bringing me back...
The other reset, onload etc is because as you know treegrid doesnt have paging.. so i have to make my own because it was a clients need...and also because i added to stop the grid to duplicate values
Can it be that the store isnt creating correctly? and when you click the search button it doesnt delete correctly?
Regards and thanks for answering as usual man,
there arent a lot of ppl with the will to help others.

scottmartin
9 May 2014, 2:06 PM
I would suggest looking at your store data to see what is in the store, then you can move on to the tree handling the data.

It may help to create a small fiddle, where you could have data1, data2, data3 JSON files represent the json data returned for each page.

https://fiddle.sencha.com/#home

super.rotus
9 May 2014, 3:19 PM
I think my problem is in the view, i check my store and it return a count of 1 and paint 2 records...