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
21/09/2009
10:18
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Mark,

Here is the example:

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

1. Select row

2. click Get id link ( the value from first column is alerted)

3. reorder columns so that the Inv No is not first.

4. Click next page.

5. Select row and click Get id link - the value of the first column is alerted

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.

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

Edit: I hadnt seen your last post. I do see the problem in your example. I'll keep looking...

Still not seeing it… the rowid is fetched from the row /as returned by the server/, so doesnt (and shouldnt) use orderedCols.

My example is almost identical to yours (language aside!) and Im not having any issues…

Mark

21/09/2009
10:34
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

The important thing is that after reordering you must click to next page using the pager.

Just you can see in Fire bug what are the id after reordering and clicking on next page.

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.

21/09/2009
10:42
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Mark,

I'm just looking into the code how to fix this.

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.

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

OK. I see the problem.

"reader" returns the items in the current order. So for repeatitems false, the index is looked up incorrectly.

Should be easy to fix - I'll take a look tonight (if you havent fixed it first).

Mark

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

I've pushed a fix.

I've made a small change to the xml reader behavior - if the id is a number, it uses it as the column index (just like the json reader).

Otherwise, I think the behavior is as before (except that id's are now correct after reordering with repeatitems:false, and a numeric id, or a "key" field).

There are a lot of cases - Im not sure Ive tested them all...

Mark

22/09/2009
04:29
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Mark,

Sorry that I do not see your last message. With my last post I mean, that I will fix this.

I pushed my solution in the GitHub. I have made allmost all tests, but not the full ones.

Will see and test your solution. We should at end put one.

Sorry 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.

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

Hi Tony,

No problem. But I see a couple of issues with your solution:

i) you can no longer change xmlReader.id, jsonReader.id, xmlmap or jsonmap after the grid is created

ii) it doesnt handle the case of ts.p.xmlReader.id is an integer, and repeatitems is true.

iii) there's a bug in the xmlreader:  if(f && ts.p.keyIndex[1]) idn = ts.p.keyIndex[1];
That should be if (f.length...) since f is always true. This is in part related to ii), but fixing this doesnt fix ii).

Mark

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

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

Mark,

Thanks for iii) and ii) .

Also you are right, in my solution is not possible to make these dynamic (as before).

My primary goal (as of the whohle grid) was speed, but it seems that in this case we can not implement my fix.

Will test your fix tomorrow and make a merge.

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.

22/09/2009
13:32
Avatar
markw65
Member
Members
Forum Posts: 179
Member Since:
30/07/2009
sp_UserOfflineSmall Offline

Tony,

Regarding speed - I completely agree, and I think your efforts have certainly paid off; jqGrid is very fast.

But the cost of a lookup in an array of length "n", is completely dwarfed by the cost of fetching a number of lines of length "n" from a remote server, creating table rows from them, and inserting them into the DOM. I think we can afford to do the lookup once per fetch...

Also, for things like this (if performance /was/ an issue), you could cache the last value and then check to see if the cached result is valid - and get the performance but keep things dynamic...

Mark

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

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

Mark,

Looking deeper in your fix I will say, that it is better than my.

I have merged the fix. I do not have do all the tests, but I think during the release we will polish it.

About cache!?! Cache IMHO should be applied with care and I do not want implement it currently in the grid.

I think that all is ok with the fix – suppose that the most grids contain 5-30 columns, this will not impact too much the performance, looping only once per request throght the array.

As your said – the most heavy things are when we do with  DOM manipulation.

Next week (if all goes ok) I will do more on the grid as promised. It is pleasure for me to work with you.

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.

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

tony said:

Again me,

This is not correct fix. The correct fix should be in multiselect plugin – i.e when we add a new visible column (whitout reordering) the select list should be updated.

Tony


Tony,

I've just pushed a fix. I've overridden the ui.multiselect's _setSelected method to keep the options array sorted correctly.

Mark

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

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

Mark,

Thanks. Merged.

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.

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

Most Users Ever Online: 715

Currently Online:
34 Guest(s)

Currently Browsing this Page:
2 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