La primera vez se cargan los datos bien en el primer grid pero cuando intento traer mas datos los carga pero me arroja un error para esta linea de codigo del ext-all.js:
this.scroller.dom.scrollTop=0
y luego cuando intento arrastrar me arroja un error en la siguiente linea de codigo del ext-base.js:
return[M.left+N.left,M.top+N.top]
el primer error ocurre cuando hago firstGridStore.loadData(myDataCol); en el siguiente codigo:
- Código: Seleccionar todo
function tablas(myDataCol, myDataPer,division){
// Column Model shortcut array
var cols = [
{ id : 'name', header: "Usuario", width: 20, sortable: true, dataIndex: 'name',hidden: 'true'},
{header: "Nombre Colaborador", width: 130, sortable: true, dataIndex: 'column1'},
{header: "Cargo", width: 190, sortable: true, dataIndex: 'column2'}
];
// Grid de Colaboradores sin permisos
var firstGrid = new Ext.grid.GridPanel({
ddGroup : 'secondGridDDGroup',
store : firstGridStore,
columns : cols,
enableDragDrop : true,
stripeRows : true,
autoExpandColumn : 'name',
width : 325,
region : 'west',
title : 'Colaboradores'
});
// Colaboradores con permisos
var secondGrid = new Ext.grid.GridPanel({
ddGroup : 'firstGridDDGroup',
store : secondGridStore,
columns : cols,
enableDragDrop : true,
stripeRows : true,
autoExpandColumn : 'name',
width : 325,
region : 'center',
title : 'Colaboradores con Permisos'
});
//Simple 'border layout' panel to house both grids
var displayPanel = new Ext.Panel({
width : 650,
height : 300,
layout : 'border',
renderTo : division,
items : [
firstGrid,
secondGrid
],
bbar : [
'->', // Fill
{
id:'Cargar',
text : 'Cargar Datos',
handler : function() {
//refresh source grid
firstGridStore.removeAll();
try{
firstGridStore.loadData(myDataCol);
}catch(e){'alert(fisrtGridStore');}
if(controlCargarDatos==0){
secondGridStore.removeAll();
secondGridStore.loadData(myDataPer);
controlCargarDatos=1;
}
for(var j=0;j<secondGridStore.getCount();j++){
for(var z=0;z<firstGridStore.getCount();z++){
if(firstGridStore.getAt(z).get('name')==secondGridStore.getAt(j).get('name')){
firstGridStore.remove(firstGridStore.getAt(z));
}
}
}
}
}
]
});
// used to add records to the destination stores
var blankRecord = Ext.data.Record.create(fields);
/****
* Setup Drop Targets
***/
// This will make sure we only drop to the view container
var firstGridDropTargetEl = firstGrid.getView().el.dom.childNodes[0].childNodes[1];
var firstGridDropTarget = new Ext.dd.DropTarget(firstGridDropTargetEl, {
ddGroup : 'firstGridDDGroup',
copy : true,
notifyDrop : function(ddSource, e, data){
try{
// Generic function to add records.
function addRow(record, index, allItems) {
// Search for duplicates
var foundItem = firstGridStore.find('name', record.data.name);
// if not found
if (foundItem == -1) {
firstGridStore.add(record);
// Call a sort dynamically
firstGridStore.sort('name', 'ASC');
//Remove Record from the source
ddSource.grid.store.remove(record);
}
}
// Loop through the selections
Ext.each(ddSource.dragData.selections ,addRow);
return(true);
}catch(e){alert(firstDD)}
}
});
// This will make sure we only drop to the view container
var secondGridDropTargetEl = secondGrid.getView().el.dom.childNodes[0].childNodes[1]
var destGridDropTarget = new Ext.dd.DropTarget(secondGridDropTargetEl, {
ddGroup : 'secondGridDDGroup',
copy : false,
notifyDrop : function(ddSource, e, data){
try{
// Generic function to add records.
function addRow(record, index, allItems) {
// Search for duplicates
var foundItem = secondGridStore.find('name', record.data.name);
// if not found
if (foundItem == -1) {
secondGridStore.add(record);
// Call a sort dynamically
secondGridStore.sort('name', 'ASC');
//Remove Record from the source
ddSource.grid.store.remove(record);
}
}
// Loop through the selections
Ext.each(ddSource.dragData.selections ,addRow);
return(true);
}catch(e){alert('secondDD');}
}
});
};
y en el siguiente codigo es donde intento volver a cargar nuevos datos en el objeto para pasarselos al grid:
- Código: Seleccionar todo
if(id=='dbColaboradores'){
if(editar=='false') myDataP.records.clear=0;
myDataC.records.clear();
var objTipos = "";
for(var i=1;i<list.length;i++){//el primer elemento es el header de la lista
var objTipos = {
name : list[i][0],
column1: list[i][1],
column2: list[i][2]
};
myDataC.records.push(objTipos);
}
tablas(myDataC, myDataP,division);
}
Ayuda por favor no se que hacer!!!!
Nota: En Mozilla funciona a la perfeccion.

