Author Topic: It's not working to remove groupModel with inserting 'null'  (Read 3363 times)

methney

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 7
    • View Profile
It's not working to remove groupModel with inserting 'null'
« on: August 28, 2014, 12:21:28 pm »
Hi there!

I'm using groupModel. I got reference from grouping demo (http://paramquery.com/pro/demos/group_rows)

And I have a select box to choice view type.
One is grouping as default, the other is 'not grouping' (just sequential order)

but when to change to 'not grouping', here is my code

$("#grid_group_rows").pqGrid("option", "groupModel", null);
$("#grid_group_rows").pqGrid("refresh");

when executing this, there are no rows left at all.
Data are totally dispeared..

So I just tried several ways..
refresh, refreshView, refreshDataAndView..

I have used same data with this example but, I tried to load data again. looking for way around...

$("#grid_group_rows").pqGrid("option", "dataModel", {data:dataModel});
$("#grid_group_rows").pqGrid("option", "title", "Log View");
$("#grid_group_rows").pqGrid("option", "groupModel.collapsed", [false]);
$("#grid_group_rows").pqGrid("option", "groupModel", null);
$("#grid_group_rows").pqGrid("refresh");

The reason I used 'groupModel.collapsed:false' is..
It worked when data are opened (grouping mode) before I choose view type to 'not-grouping' in selectbox.
Then I change mode to 'not-grouping', And finally I could see data.
I think It redrew just in opened row.

And I also think it's not working when setting 'null' as groupModel..
I have just wasted my time since yesterday. please give me help.
If there any specific example helping me, send me please.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6296
    • View Profile
Re: It's not working to remove groupModel with inserting 'null'
« Reply #1 on: August 28, 2014, 07:46:49 pm »
It has been answered earlier in the forum here http://paramquery.com/forum/index.php?topic=442

I've also updated the demo for you http://paramquery.com/pro/demos/group_rows

Please let me know if you need any further assistance.

methney

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: It's not working to remove groupModel with inserting 'null'
« Reply #2 on: August 29, 2014, 07:40:23 am »
Thanks for your reply..

But I tested...
Now I understood What options I did.
It's about the option of 'collapsed'

I made this example on jsfiddle.
http://jsfiddle.net/methney/q106rwh8/

When to push the toggle buttom having option of 'collapsed:true', it didn't make any normal rows.
But I changed the option of groupModel.collapsed : false, it worked!
I think it has problem with groupModel.collapsed:true. It's not working!
please consider this!!

thanks for your quick help! I appreciate this!!
« Last Edit: August 29, 2014, 10:16:57 am by methney »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6296
    • View Profile
Re: It's not working to remove groupModel with inserting 'null'
« Reply #3 on: August 29, 2014, 03:15:30 pm »
I got your point. When collapsed is true grouping hides the rows and when grouping is removed, hidden rows in local data are left as hidden. This issue  would be corrected in next version.

Meanwhile you can use the following code to show the hidden rows.

http://jsfiddle.net/paramquery/q106rwh8/2/
« Last Edit: August 29, 2014, 03:21:37 pm by paramquery »

methney

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: It's not working to remove groupModel with inserting 'null'
« Reply #4 on: September 01, 2014, 04:41:32 am »
Thanks! I appreciate this!!