Ext Grid to Grid DNG

hello,

I was searching for the Grid to Grid Drag and Drop on particular row of the grid so that i can change the information on drag node on respect of dropped row of another Grid.. i was left helpless … then i researched and did a long hide and trail and finally got the solution on how to do it..

so i am here to share the solution to all of you ….

this.on(‘render’,function(){
var t = this.getView();
var ddrow = new Ext.dd.DropTarget(this.getView().mainBody , {

ddGroup : ‘dropOver’,
copy:false,
notifyDrop : function(dd, e, data){
var sel = Ext.getCmp(‘individualSearchGrid’).getSelections();
var s = Ext.getCmp(‘companySearchGrid’);

var compId = t.ds.getAt(t._flyweight.dom.rowIndex).data.compId;

var checkedIndId =””;
var extra = “”;
var checkedIndGrid = [];
var ckInd = “”;
for(var i = 0; i
checkedIndId += extra + sel[i].data.contactId ;
extra = “,”;
checkedIndGrid[i] = sel[i];
}
extra = “”;
for(var i =0;i
ckInd += extra + sel[i].data.title;
extra = “,”;
}

Ext.Msg.show({
title:’Save Changes’,
msg: ‘You are about to change the individual/s company . Would you like to save your changes?’,
buttons: Ext.Msg.YESNOCANCEL,
fn: function(btn){
if(btn == “yes”){
Ext.Ajax.request({
url:’CoreModule/xhr’,
method:’post’,
url: UrlConfig.xhr,
params:{file:’xhr/IndividualProcess.php’,
action:’updateCompanyCode’,
companyid:compId,//node.attributes.compId,
txtcontactid:checkedIndId
},
success:function(req){

for(var i =0;i

var grid = Ext.getCmp(“individualSearchGrid”);
var store = grid.getStore();
var selRec = grid.getSelectionModel().getSelections();
for(var i = 0; i < selRec.length; i++)
store.remove(selRec[i]);

}
// alert(req.response.Text);
Ext.MessageBox.alert(“Drag Drop Successfull”,
“You Have Successfully Changed The Selected Invidual’s(“+ ckInd +”) Company”);
return true;

},
failure:function(req){
alert(‘Failure’);
}
});
}

},
animEl: ‘elId’,
icon: Ext.MessageBox.QUESTION
});

}
});
},this);

PS. if you have any question regarding this you can always comment on this for the reply..

regards

ExtJS, Ajax, PHP


[[[JavaScript ]]]is really rocking

Leave a Reply