Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by tabassum on Oct 22, 2008 22:54
open dhtmlx forum
Drag and Drop Dhtmlx grid

hi
I want to perform drag and drop on my grid whic populates the column while runtime but its showing me errors
my grid is
[code]

var mygrid1 = new dhtmlXGridObject('gridbox1');
    mygrid1.setImagePath("../../codebase/imgs/");
    mygrid1.setSkin("light");
    mygrid1.enableMercyDrag(true);
mygrid1.enableSmartRendering(true);
    mygrid1.enableDragAndDrop(true);
mygrid.enableMultiselect(true)
mygrid1.init();
    mygrid1.loadXML("../../NoData.xml");
    mygrid1.attachEvent("onXLE",function(){
if(mygrid1.getRowsNum()==0){
            mygrid1.clearAll();
            mygrid1.loadXML("../../NoData.xml");
    }});


where NoData.xml is
[code]

<?xml version="1.0" encoding="UTF-8"?><rows>
<head>
<column width="80" type="text" align="right" >column #1</column>
<column width="80" type="text" align="right">column #2</column>
<column width="80" type="text" align="right">column #3</column>
<column width="80" type="text" align="right" >column #4</column>
<column width="80" type="ch" align="right">column #5</column>
</head>
    <row id="some">
    <cell>No data</cell>
    <cell >No data</cell>
    
    </row>
    <row id="some2">
    <cell>No data</cell>
    <cell >No data</cell></row></rows>


Actually i wan to accomplish something like this (i have 2 grids leftgrid and rightgrid)m leftygrid gets populated during runtime and the last columnof the leftgrid contains checkbox when a checkbox against particular row is checked and 'pass right' button is pressed the checked row should pass to the rightgrid Similarly when a checkox in leftgrid is checked and the 'pass left' button pressed the row checked should pass in leftgrid.
also i want to get the cell value from the grid.. please help me and suggest me how to do this....
    
Answer posted by Support on Oct 23, 2008 02:06
>> I want to perform drag and drop on my grid whic populates the column while runtime but its showing me errors

Which errors have you got ?

The sample looks correct.

Please, check if _drag.js and _srnd.js libraries are included.

If problem persists, please, provide the sample directly at the support@dhtmlx.com

>> Actually i wan to accomplish something like this (i have 2 grids leftgrid and rightgrid)m leftygrid gets populated during runtime and the last columnof

There is onCheck event which occur after checkbox is clicked.

grid.attachEvent("onCheck",function(row_id,column_index,state){
    /*your code here*/
})

And getValue allows to  get cells value:

var value = grid.cells(row_id,column_index).getValue();