Author Topic: paste row set value hidden column  (Read 3277 times)

luckduck

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 46
    • View Profile
paste row set value hidden column
« on: July 24, 2019, 09:57:32 am »
Hi,

Will the values be set only for visible columns when pasting?

I want to set the value in the hidden column of the line I added by paste in the tree grid.


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: paste row set value hidden column
« Reply #1 on: July 25, 2019, 08:47:20 am »
Values are pasted in hidden columns too.

luckduck

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: paste row set value hidden column
« Reply #2 on: July 25, 2019, 01:21:14 pm »
Thanks you very much for your reply.

I do not want to paste the data in the entire column, but I want to paste some column data and set the values in the remaining columns.


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: paste row set value hidden column
« Reply #3 on: July 25, 2019, 01:50:41 pm »
Sorry I don't get your question. Could you please elaborate it.

What are the values in the clipboard?

Values are pasted on the destination columns depending upon the number of columns in the clipboard and number of selected columns. In your screenshot, only first column is selected, hence values are pasted in that column only.
« Last Edit: July 25, 2019, 01:52:25 pm by paramvir »

luckduck

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: paste row set value hidden column
« Reply #4 on: July 25, 2019, 02:26:49 pm »
I copied and pasted only the item "ITEM" as shown in the screenshot, and I want to create the key "groupCd" item as a separate logic.

1. Copy ITEM items from Excel.
2. Paste it into the ITEM column of the grid.
3. Grid rows are added as much as the pasted ITEM.
4. The values of other columns in the pasted row are automatically set according to the value of "ITEM".

Can I use "paste" or "beforePaste" to set values in columns like "updateRow"?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: paste row set value hidden column
« Reply #5 on: July 25, 2019, 03:39:20 pm »
oh ok, got your question.

Dependencies between columns can be setup easily with js formulas.

Please check this demo:

https://paramquery.com/pro/demos/grid_formula

Values in formula columns are automatically updated, no need of beforePaste, paste events.
« Last Edit: July 25, 2019, 03:41:23 pm by paramvir »

luckduck

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: paste row set value hidden column
« Reply #6 on: July 25, 2019, 04:23:03 pm »
I solved the problem thanks to you.