Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
This topic is locked No permission to create posts
sp_Feed Topic RSS sp_TopicIcon
Re-order columns
10/09/2009
03:21
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello Mark,

Excelent work. Also I begin the full tests, before merging the commit

For now

1. IE6 (only) - does not work at all. The message when I try to resize (not reorder) is width is not a object or null in grid.headers object

2. IE8 (only) - when used with treeGrid - the column is allway moved to last one when try to reorder.

3. Safari, Chrome - when we enable filterToolbar the toolbar row element disapper (width 0) after reorder.

I will make some other tests and if I have time today I will try to find the reasons of these issues.

Thanks again.

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

10/09/2009
12:33
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

The fix for IE6 and IE7

in mousedown and and click events

if(isMSIE) {ci = $.jgrid.getAbsoluteIndex(thr,ci);

should be

if(isMSIE) {ci = $.jgrid.getAbsoluteIndex(thr[0],ci);

Look at nexts

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

10/09/2009
15:52
Avatar
markw65
Member
Members
Forum Posts: 179
Member Since:
30/07/2009
sp_UserOfflineSmall Offline

Good catch... I'd stared at those lines, and still not seen it.

But that reminds me - why not have a $.jgrid.getCellIndex(cell), which does both steps for you (ie cell.cellIndex, and then getAbsoluteIndex when necessary)? There's a lot of places where thats done, and it would make things less error prone.

Also, wouldnt $.inArray(cell, cell.parentNode.cells) be a simple/efficient enough implementation? Then no need for the browser sniffing/fixup?

Let me know if you find any more fixes - I'll take a look at the rest tonight...

Mark

11/09/2009
02:24
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello Mark,

I will think on your recommendation about getCellIndex - this have sense.

About Safari Chrome - it seems that this is a bug in UI sortable: http://dev.jqueryui.com/ticket/4765

Also we can set the td width's of that row using grid.headers (when Safari Chrome), but I'm not sure if this a reasonable solution.

Also for me the more important bug is in IE8 when we have some hidden columns at all. You can try this.

Also this does not occur in IE7 and IE6.

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

11/09/2009
09:37
Avatar
markw65
Member
Members
Forum Posts: 179
Member Since:
30/07/2009
sp_UserOfflineSmall Offline

Tony,

I've not managed to reproduce your tree grid issue, but I do see a possibly releated problem...

Depending on the page, ie8 will sometimes get cellIndex right (like FF etc), and sometimes get it wrong (like ie6,7). So your test in getAbsoluteIndex for browser.version <= 7 doesnt really work.

The problem is that when ie8 runs in compatibility mode, it still reports its version number as 8, but emulates the behavior of 7.

The only fix I can think of is what I suggested above, so I've added $.jgrid.getCellIndex (which uses inArray for msie, and cellIndex for everything else), and removed getAbsoluteIndex altogether.

I've pushed the changes to my fork - perhaps this will fix your problems too?

On the sortable bug - I think it /is/ a bug in sortable, but I dont think its that one. That happens when you're trying to sort rows, because (apparently) webkit doesnt render empty <tr> elements, and so the placeholder doesnt show up. But in this case, its an empty <th> element. And in any case, it /does/ show up. Its the cell in the row below that disappears!

Mark

11/09/2009
09:52
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Just now I prepared the same - replace the getAbsolutelIndex with the one recommended from you.

Better I will download your code and test.

Will let yo known about the tests.

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

11/09/2009
10:01
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello Mark,

Does not work after last download.

To reproduce.

Create a grid with some hidden coulmns and test in IE 8.

The sortable column moves to the last one. I feel that in some other place is the bug.

Will try to investigate

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

11/09/2009
10:16
Avatar
markw65
Member
Members
Forum Posts: 179
Member Since:
30/07/2009
sp_UserOfflineSmall Offline

Something subtle then - because its working perfectly for me (after the getCellIndex fix).

Can you point me to a webpage thats /not/ working for you?

The fact that it happens with hidden columns, and that it moves to the end (ie further than it should) suggests to me that it has /something/ to do with cellIndex.

By the way - do your columns sort/resize correctly?

I'll keep looking...

Mark

11/09/2009
10:22
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Mark,

Will prepare after some minutes a demo

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

11/09/2009
10:31
Avatar
markw65
Member
Members
Forum Posts: 179
Member Since:
30/07/2009
sp_UserOfflineSmall Offline

Ok, the problem is that I have

    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

in my header (because I use other features that dont work otherwise). And that solves the problem (without my getCellIndex fix, it causes lots of other problems though!).

It looks like another sortable bug (I'll try to create a non jqGrid example). But meanwhile, the above seems to be a reasonable workaround...

Mark

11/09/2009
10:49
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Sorry,

Little delayed.

http://www.trirand.com/test/jqgrid.html

Loading Data - > Local Data

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

11/09/2009
11:29
Avatar
markw65
Member
Members
Forum Posts: 179
Member Since:
30/07/2009
sp_UserOfflineSmall Offline

Tony,

I've put a very simple testcase up at http://maps.myosotissp.com/bug.....sort2.html

It shows that the problem is with ie8/sortable. If instead you visit it as http://maps.myosotissp.com/bug.....html?ie7=1, it you get the same page with the "meta" line inserted, and everything works as expected.

I'll file a bug against sortable/jquery-ui.

Mark

11/09/2009
11:38
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Thanks Mark,

To be a honest I want that our code was buggy 🙂

So we will wait for the fix, but as I see this will not be done in the near future.

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

11/09/2009
12:41
Avatar
markw65
Member
Members
Forum Posts: 179
Member Since:
30/07/2009
sp_UserOfflineSmall Offline

Well, there /is/ a workaround - and I've found that I need it for lots of the things I use (openlayers, google visualizations etc, google earth until very recently).

But I will keep digging into the sortable code to see if I can figure out what's causing it - there may still be a simple fix.

Mark

11/09/2009
17:55
Avatar
markw65
Member
Members
Forum Posts: 179
Member Since:
30/07/2009
sp_UserOfflineSmall Offline

So it's actually an interesting bug - probably in ie8 - although I think its more just a case of ie8 doing something surprising.

jQuery makes the assumption that anything hidden will have zero size. But hidden td/th elements in ie8 actually have the size of the tr element that contains them.

So this breaks two things. First the ":hidden" selector doesnt work for td/th elements, and so my "items" selector selects all the columns (hidden or not) for sorting.

That wouldnt matter, except that sortable doesnt test to see if the items are visible, it just assumes that hidden items will have zero size, and so does no special checking. As a result, the mouse is /always/ over the hidden items.

Fortunately, the fix is simple. For $.browser.msie && $.browser.version==8, I redefined the ":hidden" attribute to additionally check for style.display=="none". So the hidden items dont make it into the sortable list, and everything works.

Ill push to gitHub in a while.

Mark

12/09/2009
09:37
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello Mark,

Big Thanks. Everthing work OK for now.

I have commited all your changes.

I have make some design changes which include: Moving the sortable columns as separate module grid.jqueryui.js. The reason for this is since this depend on jQuery UI we can later include other things like - sortable rows, drag and drop between two grids and etc. I think that this is reasonable change. Also I have moved the hack for IE8 on this module too.

Now I continue with the other planed things: configurable ajax requests and rtl support.

Again thank you for this excellent work.

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

12/09/2009
10:18
Avatar
markw65
Member
Members
Forum Posts: 179
Member Since:
30/07/2009
sp_UserOfflineSmall Offline

Hi Tony,

Great - and thanks for all your work!

Putting the sortable code in a separate module certainly makes sense (although it doesnt /depend/ on jquery-ui - it simply doesnt do anything unless sortable is loaded). But remapColumns is self standing. My code uses it in a number of places independently of the sortable code (I added sortable support as an afterthought).

It doesnt really matter to me - because I will be including the sortable code anyway - but it seems like remapColumns should be a part of the base functionality.

Mark

12/09/2009
10:32
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

I think I will do it.

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

12/09/2009
12:54
Avatar
markw65
Member
Members
Forum Posts: 179
Member Since:
30/07/2009
sp_UserOfflineSmall Offline

Thanks.

I also just noticed you took all the newapi changes - thats great! My fork matches yours 🙂

Would it make sense to make a 3.5.3 branch (or maybe call it 3.5, but based off 3.5.3)? Particularly after the newapi changes, it may make sense to push bugfixes to 3.5 while working on 3.6...

Mark

12/09/2009
17:12
Avatar
markw65
Member
Members
Forum Posts: 179
Member Since:
30/07/2009
sp_UserOfflineSmall Offline

One last feature... I've just added a columnChooser method to grid.jqueryui.js.

This pops up a dialog allowing you to select which columns to display, and set the order in one go.

It depends on ui.dialog, and ui.multiselect (http://www.quasipartikel.at/multiselect). It will work without ui.multiselect, but then you lose the ability to reorder the columns.

Mark

This topic is locked No permission to create posts
Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
58 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information