PDA

View Full Version : drag and drop grid with rowaction



ByteLess
16 Mar 2011, 9:00 AM
I have a following drag and drop grid, which is working fine without row action, but once I have rowaction in my 2nd grid, I am unable to drop the item in that grid.

can some one please direct me to the right path that what is I am missing in it?
Thanks,





var UXSODetailsL = new Ext.ux.grid.RowActions({
actions: [{
iconCls: "icon-labels",
hideIndex: "scan_req",
tooltip: " Scan Serial ",
callback: function(grid, record, action, row, col) {
var wn_SOSelAcceptOut = new Ext.Window({
title: 'SO Serails for Item # ' + record.data.item_number,
autoHeight: true,
width: 350,
id: 'wn_SOSelAcceptOut',
x: 100,
y: 5,
modal: true,
closeable: true,
closeAction: 'destroy',
renderTo: 'SOLines_div',
autoLoad: {
url: 'wn_scanserialsOUT.cfm?son=' + record.data.so_number + '&plid=' + record.data.id + '&qty=' + record.data.quantity,
scripts: true
}
}).show();
},


dummy: true
}],


dummy: true
});
var displayPanel = new Ext.Panel({
height: 300,
layout: "border",
renderTo: "panel",
width: 880,
items: [new Ext.grid.GridPanel({
enableDragDrop: true,
id: "firstGrid",
loadMask: true,
selModel: new Ext.grid.RowSelectionModel({
singleSelect: false
}),
store: firstGridStore,
stripeRows: true,
title: "SO Items List",
width: 440,
ddGroup: "secondGridDDGroup",
columns: [new Ext.grid.RowNumberer({




dummy: true
}),
{
dataIndex: "id",
header: "ID",
hidden: true,
id: "id",
sortable: false,
width: 80,

dummy: true
}, {
dataIndex: "subinventorycode",
header: "SubInventoryCode",
hidden: true,
id: "SubInventoryCode",
sortable: false,
width: 80,

dummy: true
}, {
dataIndex: "so_number",
header: "so_number",
hidden: true,
id: "po_number",
sortable: false,
width: 80,

dummy: true
}, {
dataIndex: "item_number",
header: "Item Number",
id: "item_number",
renderer: createToolTip,
sortable: false,
width: 80,

dummy: true
}, {
dataIndex: "item_description",
header: "Description",
id: "item_description",
renderer: createToolTip,
sortable: false,
width: 180,

dummy: true
}, {
dataIndex: "quantity",
header: "Qty Ordered",
id: "quantity",
sortable: false,
width: 50,
editor: new Ext.form.TextField({
allowBlank: false,
fieldLabel: "Text Field 8 9 5",
name: "textField895",
width: 200,

dummy: true
}),

dummy: true
}, {
dataIndex: "qty_received",
header: "Received ",
id: "qty_received",
sortable: false,
width: 50,

dummy: true
}, {
dataIndex: "qty_remaining",
header: "Remaining ",
id: "qty_remaining",
renderer: qtyremaining,
sortable: false,
width: 50,

dummy: true
}],
region: "west",

dummy: true
}), new Ext.grid.EditorGridPanel({
enableDragDrop: true,
id: "secondGrid",
loadMask: true,
plugins: [UXSODetailsL],
selModel: new Ext.grid.RowSelectionModel({
singleSelect: true
}),
store: secondGridStore,
stripeRows: true,
title: "Item Selection",
width: 325,
columns: [new Ext.grid.RowNumberer({




dummy: true
}),
{
dataIndex: "id",
header: "ID",
hidden: true,
id: "id",
sortable: false,
width: 80,

dummy: true
}, {
dataIndex: "subinventorycode",
header: "SubInventoryCode",
hidden: true,
id: "SubInventoryCode",
sortable: false,
width: 80,

dummy: true
}, {
dataIndex: "so_number",
header: "so_number",
hidden: true,
id: "po_number",
renderer: createToolTip,
sortable: false,
width: 70,

dummy: true
}, {
dataIndex: "item_number",
header: "Item Number",
id: "item_number",
renderer: createToolTip,
sortable: false,
width: 70,

dummy: true
}, {
dataIndex: "item_description",
header: "Description",
id: "item_description",
renderer: createToolTip,
sortable: false,
width: 200,

dummy: true
}, {
dataIndex: "quantity",
header: "Qty Pulled",
id: "quantity",
renderer: qtyremaining,
sortable: false,
width: 70,
editor: new Ext.form.TextField({
allowBlank: false,
fieldLabel: "Text Field 5 6 9",
name: "textField569",
width: 200,

dummy: true
}),

dummy: true
},
UXSODetailsL],
region: "center",

dummy: true
})],

dummy: true
});

ByteLess
16 Mar 2011, 9:06 AM
/****
* Setup Drop Targets
***/
// This will make sure we only drop to the view container
var firstGridDropTargetEl = Ext.getCmp("firstGrid").getView().el.dom.childNodes[0].childNodes[1];
var firstGridDropTarget = new Ext.dd.DropTarget(firstGridDropTargetEl, {
ddGroup: 'firstGridDDGroup',
copy: true,
notifyDrop: function (ddSource, e, data) {

// Generic function to add records.


function addRow(record, index, allItems) {

// Search for duplicates
var foundItem = firstGridStore.find('id', record.data.id);
// if not found
if (foundItem == -1) {
firstGridStore.add(record);

// Call a sort dynamically
//firstGridStore.sort('id', 'ASC');
//Remove Record from the source
ddSource.grid.store.remove(record);
}
}

// Loop through the selections
Ext.each(ddSource.dragData.selections, addRow);
return (true);
}
});


// This will make sure we only drop to the view container
var secondGridDropTargetEl = Ext.getCmp("secondGrid").getView().el.dom.childNodes[0].childNodes[1]

var destGridDropTarget = new Ext.dd.DropTarget(secondGridDropTargetEl, {
ddGroup: 'secondGridDDGroup',
copy: false,
notifyDrop: function (ddSource, e, data) {

// Generic function to add records.


function addRow(record, index, allItems) {

// Search for duplicates
var foundItem = secondGridStore.find('id', record.data.id);
// if not found
if (foundItem == -1) {
secondGridStore.add(record);
// Call a sort dynamically
//secondGridStore.sort('id', 'ASC');
//Remove Record from the source
ddSource.grid.store.remove(record);
}
}
// Loop through the selections
Ext.each(ddSource.dragData.selections, addRow);
return (true);
}
});

ByteLess
17 Mar 2011, 5:55 AM
can someone tell me even its possible?