Export to GitHub

struts2-jquery - issue #417

sjg:grid draggable="false" does not work


Posted on Jan 31, 2011 by Helpful Giraffe

What steps will reproduce the problem?

  1. Code is as below :- <s:url id="remoteurl" action="fetchResults" /> <sjg:grid id="grid" href="%{remoteurl}" dataType="json" pager="true" gridModel="gridModel" draggable="false" rowList="5,10,15,20,50,100" rowNum="10" rownumbers="false" width="700" hoverrows="false" cssStyle="font-size:12px;" viewrecords=" true" sortable="true" > ........ </sjg:grid>

  2. The grid is shown correctly on page load.

  3. However the columns are still draggable.

What is the expected output? What do you see instead? Even after setting draggable as false, the columns are draggable.

Which struts2 version? 2.2.1

Which struts2-jquery plugin version? 2.5.1

Please provide any additional information below. NA

Comment #1

Posted on Feb 1, 2011 by Helpful Giraffe

Comment deleted

Comment #2

Posted on Feb 1, 2011 by Helpful Giraffe

Alright i had a look at draggable attribute description and its given as "Enable draggable functionality to the DIV element. Move the draggable object by clicking on it with the mouse and dragging it anywhere within the viewport."

So this i guess is for the entire grid. I want the columns of the grid to be NOT draggable, which they are by default.

Could you tell how one can do so.

Comment #3

Posted on Feb 1, 2011 by Swift Lion

the draggable attribute enables D&D for grid, see the example in the grid showcase. but you are right ther is a attribute missing to enable/diasable dragable columns.

Comment #4

Posted on Feb 1, 2011 by Helpful Giraffe

And also draggable rows....

Comment #5

Posted on Feb 8, 2011 by Swift Lion

sortable for columns can be disabled and enabled with the sortable attribute.

Comment #6

Posted on Feb 12, 2011 by Helpful Giraffe

i believe you mean 'draggable' for columns. I am hoping you have also added an attribute for disabling 'draggable' in rows.

Comment #7

Posted on Feb 13, 2011 by Helpful Giraffe

Comment deleted

Comment #8

Posted on Feb 13, 2011 by Helpful Giraffe

Comment deleted

Comment #9

Posted on Feb 14, 2011 by Helpful Giraffe

Comment deleted

Comment #10

Posted on Feb 14, 2011 by Helpful Giraffe

Comment deleted

Comment #11

Posted on Feb 14, 2011 by Swift Lion

No i mean sortable. the draggable and dropable attribute is for D&D between two grids.

with attribute sortable you enable sortable for columns and with attribute sortableRows you can enable sortable for rows.

Comment #12

Posted on Feb 21, 2011 by Helpful Panda

I wrote a comment about the drag an drop possibility for the gridColumns, to change the order of them, in the grid section before i found this issue. Is this now possible in version 2.5.3 or is the draggable="fals" problem only fixed? I use version 2.5.0 and the order of the gridColumns can not be changed. With the jQuery plugin "dragtables.js" works with normal tables.

Comment #13

Posted on Feb 22, 2011 by Helpful Panda

I have seen what I want (changing the order of the gridColumns) works in version 2.5.0. I was confused about sortable an draggable aatribute, because I change not the sortorder of the columns, I drag one column to the end or anywhere else in the grid so I believe this is not a sorting.

Comment #14

Posted on Feb 22, 2011 by Swift Lion

you can now change the order of grid columns with

Comment #15

Posted on Feb 23, 2011 by Helpful Giraffe

Comment deleted

Comment #16

Posted on Feb 23, 2011 by Helpful Giraffe

Comment deleted

Comment #17

Posted on Feb 23, 2011 by Helpful Giraffe

i confirm that :-

-> The rows of the grid are now by default NOT draggable within the grid. And you cannot drag then within the grid even if you want to.

-> The columns of the grid are now by default NOT draggable within the grid. And you can make them draggable within the grid by

Comment #18

Posted on Feb 23, 2011 by Helpful Giraffe

Just a note to one of your previous comments, I know draggable and dropable attribute is for D&D between two grids

But isn't this fix misleading (as suggested by inperc...@googlemail.com also.) The word "Sortable" should ideally imply whether you want a particular column to be well, sortable. i.e. whether double clicking on the header of that column would sort the grid based on it.

There should be some attribute with the word "draggable___" for this fix, else its just misleading.

Status: Fixed

Labels:
Type-Enhancement Priority-Low Component-Grid-Plugin Milestone-2.5.2