Author Topic: Filter select options from column content, copy/paste of data over cell select  (Read 3758 times)

mrgreen123

  • Newbie
  • *
  • Posts: 3
    • View Profile
I have this ParamQuery grid setup here:

http://jsfiddle.net/Lfzestr9/3/

But I need some help with the following:

1. How can I make the options available for the filter select be dynamic from the content in the column?
2. Is there a way to stop copy and paste of values which are not in the select? For example if you copy the 1,2,3 from the first column you can paste that over the top of the country column data - but that data should only be test1, test3 or test5 as it's a select field. I don't want to remove the copy paste function completely just don't want users to enter incorrect data.
3. I can use
Code: [Select]
$grid.pqGrid('option', 'dataModel.data'); to get all the data, but is there a way to get row data for any rows that have had their cells edited - and not all data. If saving to database doesn't seem right to save everything when only a few changes have been made.
4. It's difficult to understand which parts of the plugin are the standard GPL version and which are pro - are any of the features I am using here pro? If I don't have the pro version are these not included in the demo files so everything I am using isn't pro?
« Last Edit: January 29, 2019, 07:56:46 pm by mrgreen123 »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
1) In this example https://paramquery.com/demos/filter_header_local, data in filter select list for ShipRegion column is dynamic based on content in column.

getData method https://paramquery.com/api#method-getData is used to get unique data in column.

3) Please use getChanges method to get changes: https://paramquery.com/api#method-getChanges

Example: https://paramquery.com/demos/editing_batch

4) Free version and Pro version are different. All the demos in this section https://paramquery.com/demos are for free version.

and https://paramquery.com/api is the API for free version.
« Last Edit: February 06, 2019, 12:11:36 pm by paramquery »

mrgreen123

  • Newbie
  • *
  • Posts: 3
    • View Profile
Thanks for the info, the only part of this I can't do is the validation of the select options.

So for example in this example:

https://paramquery.com/demos/filter_header_local

You can copy and paste countries over the top of cells in the shipping region column (making those values not one of the options) - is there a way to stop this?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Paste can be prevented by adding pasteModel: {on: false}

https://paramquery.com/api#option-pasteModel

If you want to make paste or edit values part of the filter select options then repeat this ( put in a function ):

Code: [Select]
var column = grid.getColumn({ dataIndx: "ShipRegion" });
                var filter = column.filter;
                filter.cache = null;
                filter.options = grid.getData({ dataIndx: ["ShipCountry", "ShipRegion"] });
                grid.refreshHeader();