EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
May 15, 2024, 02:58:04 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
General Discussion
>
Pivot Grid Column Order
Pages: [
1
]
« previous
next »
Print
Author
Topic: Pivot Grid Column Order (Read 10918 times)
Prasad
Newbie
Posts: 4
Pivot Grid Column Order
«
on:
March 07, 2016, 10:39:52 AM »
I am using Pivot Grid to display "Jan to Dec" columns. Unfortunately, the column order is not maintained. I am getting random column order for each refresh/filter. Is there a way to control the column order?
Logged
jarry
Administrator
Hero Member
Posts: 2264
Re: Pivot Grid Column Order
«
Reply #1 on:
March 07, 2016, 08:47:43 PM »
Please show an example with some sample data to demonstrate your issue.
Logged
Prasad
Newbie
Posts: 4
Re: Pivot Grid Column Order
«
Reply #2 on:
March 10, 2016, 11:56:24 PM »
Sorry for the late reply.
I could not attach an image. I tried to reproduce in jsfiddle, but didn't manage to make it work. But I believe you could help me by looking at the code. Thank you.
https://jsfiddle.net/zgxege1w/24/
Logged
jarry
Administrator
Hero Member
Posts: 2264
Re: Pivot Grid Column Order
«
Reply #3 on:
March 11, 2016, 10:29:07 AM »
Please refer to
http://jsfiddle.net/zgxege1w/25/
Logged
Prasad
Newbie
Posts: 4
Re: Pivot Grid Column Order
«
Reply #4 on:
March 11, 2016, 03:58:57 PM »
Wow, jsfiddle is working. [I didn't expect <style> tag to be reversed]
Coming back to the original request, Is it possible to correct the order of column in ascending? Jul-16 followed by Dec-16. Appreciate your help.
Logged
jarry
Administrator
Hero Member
Posts: 2264
Re: Pivot Grid Column Order
«
Reply #5 on:
March 11, 2016, 07:20:45 PM »
You have to sort your data according to your custom logic before loading into pivotgrid.
Code:
data.sort(function(r1,r2){
...
});
$('#pg').pivotgrid({
data: data
...
});
Logged
Prasad
Newbie
Posts: 4
Re: Pivot Grid Column Order
«
Reply #6 on:
March 11, 2016, 08:33:31 PM »
Thanks a lot. Saved my day
http://jsfiddle.net/zgxege1w/35/
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...