Author Topic: Ask about the Gird collapsible feature.  (Read 1510 times)

juroinstruments

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 14
    • View Profile
Ask about the Gird collapsible feature.
« on: November 09, 2021, 01:46:51 pm »
I'm using the "options.collapsible.on=true" option to collapse the grid.

I have two questions.

1. Can the user define and make it work as a designated icon rather than the "jq-ui" icon at a specific location outside the grid, and if possible, can the folding height be completely or a user-specified size rather than the icon size?

2. As a result of analyzing the source, "pqGrid:collapse" and "pqGrid:expand" are used as event names. Can the user subscribe to the event before or after?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Ask about the Gird collapsible feature.
« Reply #1 on: November 09, 2021, 09:49:33 pm »
1. yes it can be controlled programmatically with collapse and expand methods.

https://paramquery.com/pro/api#method-collapse

https://paramquery.com/pro/api#method-expand

folding height is not configurable.

2. Events are fired after collapse / expand is complete.

juroinstruments

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Ask about the Gird collapsible feature.
« Reply #2 on: November 15, 2021, 09:27:46 am »
2. Events are fired after collapse / expand is complete. <= not working

grid.collapse();
grid.expand();


from api guide : https://paramquery.com/pro/api77#event-complete
=> complete( event, ui ) Type: pqGrid:complete
=> Triggered when grid has completed data binding and view rendering. This event is generated once for each call to refreshDataAndView method.

is Right?
just collapse and expand..



paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Ask about the Gird collapsible feature.
« Reply #3 on: November 15, 2021, 10:24:53 am »
collapse and expand events are not related to and are separate from complete event.

Could you please share a jsfiddle of what you are trying to do.

juroinstruments

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Ask about the Gird collapsible feature.
« Reply #4 on: November 15, 2021, 11:36:26 am »
There is a misunderstanding when using Google Translate.

your answer =>
I am in pqgrid
To subscribe (override) the "complete" event.

It is difficult to show the related code in jsfiddle as it is not yet implemented.

---------

Just what I want is how can I subscribe to the [pqGrid:collapse,pqGrid:expand] event?


call grid.collapse() or
call grid.expand();
or
When the Collapse/Expand icon is clicked.

I wish I could see the example code.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Ask about the Gird collapsible feature.
« Reply #5 on: November 15, 2021, 12:11:37 pm »
There is common syntax to subscribe to any grid event irrespective of the event name.

https://paramquery.com/pro/tutorial#topic-events

Code: [Select]
  grid.on('collapse', function(){
    alert('collapsed');
  })
  grid.on('expand', function(){
    alert('expanded');
  })

Example: https://stackblitz.com/edit/paramquery-demo-odghqo

juroinstruments

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Ask about the Gird collapsible feature.
« Reply #6 on: November 15, 2021, 12:17:25 pm »
Thank you. It works fine.