Ask a Question related to Coldfusion Flash Integration, Design and Development.
-
sheridanbman #1
DRAG and DROP GROUP FORM GRID
I am trying to query data from a cfformgroup. I can grab data from a data
source but can not submit the updated drag and drop tables. I can not pass the
variables through the form. I have hacked away at the code so it is kind of
messy. Any help would be great if I even make sense...
<cfquery name="test" datasource="dsnNTRIDailyAss">
Select FIRST_NAME, LAST_NAME, UID
FROM tblEmployees
</cfquery>
<cfif IsDefined("FORM.updateLines") AND FORM.updateLines EQ "testForm">
<cfoutput</cfoutput>
<cfquery name="UIDcheck" datasource="dsnNTRIDailyAss">
SELECT UID
FROM tblEmployees
WHERE UID = #grdDestination.id#
</cfquery>--->
<!---<cfset Start = 1>
<cfset End = 20>
<cfloop query = "test"
startRow = "#Start#"
endRow = "#End#">--->
<cfquery datasource="dsnNTRIDailyAss">
INSERT INTO tblAssignment (ass_empID)
VALUES (#UIDcheck.UID#)
</cfquery>
<!---</cfloop>--->
</cfif>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Drag and Drop Slush Grid</title>
</head>
<body>
<cfform name="testForm" format="Flash" onload="formOnLoad()" width="100%"
height="500" >
<cfformitem type="script">
function addData()
{
//Add some data to the source grid
grdSearch.removeAll();
grdDestination.removeAll();
grdDestination2.removeAll();
grdDestination3.removeAll();
grdDestination4.removeAll();
grdDestination5.removeAll();
selSearch.removeAll();
selDestination.removeAll();
<!---grdSearch.addItem({id:1,lastName:"Smith",firstName :"Jane",phone:"(555)
555-1234"});--->
<cfset Start = 1>
<cfset End = 20>
<cfloop query = "test"
startRow = "#Start#"
endRow = "#End#">
<cfoutput>grdSearch.addItem({id:"#test.UID#",lastN ame:"#test.LAST_NAME#",first
Name:"#test.FIRST_NAME#"}); </cfoutput>
</cfloop>
selSearch.addItem({data:1, label:"Smith, Jane"});
selSearch.addItem({data:2, label:"Jones, Jen"});
}
function refreshSearch()
{
//Add some data to the source grid
grdSearch.removeAll();
selSearch.removeAll();
grdSearch.addItem({id1:"#test.UID#",lastName:"#tes t.LAST_NAME#",firstName:"#te
st.FIRST_NAME#"});
<!---grdSearch.addItem({id:1,lastName:"Smith",firstName :"Jane",phone:"(555)
555-1234"});
grdSearch.addItem({id:2,lastName:"Jones",firstName :"Jen",phone:"(555)
555-5678"});--->
selSearch.addItem({data:1, label:"Smith, Jane"});
selSearch.addItem({data:2, label:"Jones, Jen"});
}
function formOnLoad()
{
grdSearch.dragEnabled=true;
grdSearch.multipleSelection=true;
grdSearch.addEventListener('dragEnter', doDragEnterSource);
grdSearch.addEventListener('dragOver', doDragOverSource);
grdSearch.addEventListener('dragExit', doDragExitSource);
grdSearch.addEventListener('dragDrop', doDragDropDGSource);
grdSearch.addEventListener('dragComplete', doDragCompleteDGSource);
grdDestination.dragEnabled=true;
grdDestination.multipleSelection=true;
grdDestination.addEventListener('dragEnter', doDragEnterDest);
grdDestination.addEventListener('dragOver', doDragOverDest);
grdDestination.addEventListener('dragExit', doDragExitDest);
grdDestination.addEventListener('dragDrop', doDragDropDGDest);
grdDestination.addEventListener('dragComplete', doDragCompleteDGDest);
grdDestination2.dragEnabled=true;
grdDestination2.multipleSelection=true;
grdDestination2.addEventListener('dragEnter', doDragEnterDest);
grdDestination2.addEventListener('dragOver', doDragOverDest);
grdDestination2.addEventListener('dragExit', doDragExitDest);
grdDestination2.addEventListener('dragDrop', doDragDropDGDest);
grdDestination2.addEventListener('dragComplete', doDragCompleteDGDest);
grdDestination3.dragEnabled=true;
grdDestination3.multipleSelection=true;
grdDestination3.addEventListener('dragEnter', doDragEnterDest);
grdDestination3.addEventListener('dragOver', doDragOverDest);
grdDestination3.addEventListener('dragExit', doDragExitDest);
grdDestination3.addEventListener('dragDrop', doDragDropDGDest);
grdDestination3.addEventListener('dragComplete', doDragCompleteDGDest);
grdDestination4.dragEnabled=true;
grdDestination4.multipleSelection=true;
grdDestination4.addEventListener('dragEnter', doDragEnterDest);
grdDestination4.addEventListener('dragOver', doDragOverDest);
grdDestination4.addEventListener('dragExit', doDragExitDest);
grdDestination4.addEventListener('dragDrop', doDragDropDGDest);
grdDestination4.addEventListener('dragComplete', doDragCompleteDGDest);
grdDestination5.dragEnabled=true;
grdDestination5.multipleSelection=true;
grdDestination5.addEventListener('dragEnter', doDragEnterDest);
grdDestination5.addEventListener('dragOver', doDragOverDest);
grdDestination5.addEventListener('dragExit', doDragExitDest);
grdDestination5.addEventListener('dragDrop', doDragDropDGDest);
grdDestination5.addEventListener('dragComplete', doDragCompleteDGDest);
grdDestination6.dragEnabled=true;
grdDestination6.multipleSelection=true;
grdDestination6.addEventListener('dragEnter', doDragEnterDest);
grdDestination6.addEventListener('dragOver', doDragOverDest);
grdDestination6.addEventListener('dragExit', doDragExitDest);
grdDestination6.addEventListener('dragDrop', doDragDropDGDest);
grdDestination6.addEventListener('dragComplete', doDragCompleteDGDest);
grdDestination7.dragEnabled=true;
grdDestination7.multipleSelection=true;
grdDestination7.addEventListener('dragEnter', doDragEnterDest);
grdDestination7.addEventListener('dragOver', doDragOverDest);
grdDestination7.addEventListener('dragExit', doDragExitDest);
grdDestination7.addEventListener('dragDrop', doDragDropDGDest);
grdDestination7.addEventListener('dragComplete', doDragCompleteDGDest);
grdDestination8.dragEnabled=true;
grdDestination8.multipleSelection=true;
grdDestination8.addEventListener('dragEnter', doDragEnterDest);
grdDestination8.addEventListener('dragOver', doDragOverDest);
grdDestination8.addEventListener('dragExit', doDragExitDest);
grdDestination8.addEventListener('dragDrop', doDragDropDGDest);
grdDestination8.addEventListener('dragComplete', doDragCompleteDGDest);
selSearch.dragEnabled=true;
selSearch.multipleSelection=true;
selSearch.addEventListener('dragEnter', doDragEnterSource);
selSearch.addEventListener('dragOver', doDragOverSource);
selSearch.addEventListener('dragExit', doDragExitSource);
selSearch.addEventListener('dragDrop', doDragDropDGSource);
selSearch.addEventListener('dragComplete', doDragCompleteDGSource);
selDestination.dragEnabled=true;
selDestination.multipleSelection=true;
selDestination.addEventListener('dragEnter', doDragEnterDest);
selDestination.addEventListener('dragOver', doDragOverDest);
selDestination.addEventListener('dragExit', doDragExitDest);
selDestination.addEventListener('dragDrop', doDragDropDGDest);
selDestination.addEventListener('dragComplete', doDragCompleteDGDest);
_global.listOrig = '';
var grdDestListener:Object = {};
grdDestListener.mouseDown = function() {
_global.listOrig = 'grdSearch';
}
grdDestination.addEventListener("mouseDown", grdDestListener);
var grdSourceListener:Object = {};
grdSourceListener.mouseDown = function() {
_global.listOrig = 'grdDestination';
}
grdSearch.addEventListener("mouseDown", grdSourceListener);
var selDestListener:Object = {};
selDestListener.mouseDown = function() {
_global.listOrig = 'selSearch';
}
selDestination.addEventListener("mouseDown", selDestListener);
var selSourceListener:Object = {};
selSourceListener.mouseDown = function() {
_global.listOrig = 'selDestination';
}
selSearch.addEventListener("mouseDown", selSourceListener);
//Reference the grids
var listSource:Object = {};
var listDestination:Object = {};
//destination grid focus listener
var grdDestListener:Object = {};
var grdSourceListener:Object = {};
//destination select focus listener
var selDestListener:Object = {};
var selSourceListener:Object = {};
//Specify source and target flags
var overSourceItem:Boolean = false;
var overTargetItem:Boolean = false;
var alreadyDraggedOver:Boolean = false;
var alreadyEnter:Boolean = false;
var currentGrid:String = "";
//functions declared in formOnload to avoid _root prefix
function doDragEnterSource(event) {
alreadyEnter = true;
listSource = event.target;
event.handled = true;
}
function doDragEnterDest(event) {
alreadyEnter = true;
listDestination = event.target;
event.handled = true;
}
function doDragExitSource(event) {
listSource = event.target;
overSourceItem = false;
event.target.hideDropFeedback();
}
function doDragExitDest(event) {
listDestination = event.target;
overTargetItem = false;
event.target.hideDropFeedback();
}
function doDragOverSource(event) {
listSource = event.target;
currentGrid = String(listSource);
var gridArray:Array = currentGrid.split(".");
currentGrid = gridArray[gridArray.length - 1];
if (listDestination.dataProvider.length > 0)
{
overSourceItem = true;
event.target.showDropFeedback();
if (Key.isDown(Key.CONTROL))
event.action = mx.managers.DragManager.COPY;
else if (Key.isDown(Key.SHIFT))
event.action = mx.managers.DragManager.LINK;
else
event.action = mx.managers.DragManager.MOVE;
}
}
function doDragOverDest(event) {
li
sheridanbman Guest
-
Drag and drop using drag manager
Can someone help? I am dealing with drag and drop and want to be able to drop an item in a VHorizontal box. If I set a background pic then I can... -
Drag and Drop from tree Component to Data Grid
am very new to Flex. I have a Tree component with 5 child nodes and a Data Grid component. Here I want to drag the child node?s data and drop in to... -
3D Drag and Drop
I'm trying to get drag and drop to work in 3D but having no luck. Does anyone know of any Xtra's or any tutorials that would be of help in this... -
Drag and drop data between cells in a data grid
Check out this, dino has explained how to do drag and drop in datagrid http://msdn.microsoft.com/msdnmag/issues/04/01/CuttingEdge/default.aspx --... -
Drag & Drop
When I drag a movie clip (head01) into a target clip (root.Head) it works fine. The problem I'm having is when I drag another clip in (head02) I'd...



Reply With Quote

