Author Topic: Modify Copied Column From pqgrid Before Paste  (Read 881 times)

Punit

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 43
    • View Profile
Modify Copied Column From pqgrid Before Paste
« on: May 03, 2022, 10:06:07 am »
Hi Paramquery team,

We want to implement excel tagging functionality in which we try to copy multiple columns from the bind excel pqgrid and want to modify or skip some copied columns from the copied columns before the paste event and then paste on the second grid. Is there any way to achieve this? We tried to add some manually copy and paste event lister but it messes with some pqgrid functionality.

Thank you!


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6122
    • View Profile
Re: Modify Copied Column From pqgrid Before Paste
« Reply #1 on: May 03, 2022, 12:13:47 pm »
Hi Punit

Skipping columns while copy or skipping column while paste are explained in this example: https://paramquery.com/pro/demos/copy_paste

Punit

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Modify Copied Column From pqgrid Before Paste
« Reply #2 on: May 03, 2022, 04:18:21 pm »
hi
We want to skip copied column text before paste not want to skip column while pasting.

EX. If I copy 1 2 3 from grid1 then I want to skip 2  and paste only 1 3 in grid2 column.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6122
    • View Profile
Re: Modify Copied Column From pqgrid Before Paste
« Reply #3 on: May 03, 2022, 04:58:03 pm »
Ok, then may I know the reason for including column 2 in copied data when you have the option to skip column 2 while copying data?

Punit

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Modify Copied Column From pqgrid Before Paste
« Reply #4 on: May 04, 2022, 12:25:06 pm »
Hi Paramquery team,
Is it possible to skip a column while copying conditionally? or it is skipping only hidden columns?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6122
    • View Profile
Re: Modify Copied Column From pqgrid Before Paste
« Reply #5 on: May 04, 2022, 04:38:25 pm »
yes it's possible to skip columns while copying conditionally in run time. Skipping hidden columns is just an example.

Punit

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Modify Copied Column From pqgrid Before Paste
« Reply #6 on: May 09, 2022, 12:20:52 pm »
How to get all copied column lists or the number of copied columns while copying from grid1. WE get one by one copied text not all copied text at the same time.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6122
    • View Profile
Re: Modify Copied Column From pqgrid Before Paste
« Reply #7 on: May 09, 2022, 02:51:22 pm »
Sorry there is no way to get the copied data while copying currently.

Punit

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Modify Copied Column From pqgrid Before Paste
« Reply #8 on: May 10, 2022, 01:27:19 pm »
Hi,
I am trying to skip the second column by the counter. If Counter == skipCoumnValue (which is 1) then it not skipping the value. Can you please tell me what we doing wrong below code?


 columnTemplate: {
                    get [index == 0 ? 'copy' : 'paste']() {
                   
                        if (counter == skipCoumn) {
                            counter = (parseInt(counter) + 1);
                            return ;
                        }
                        else
                            counter = (parseInt(counter) + 1);
                    }
                }

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6122
    • View Profile
Re: Modify Copied Column From pqgrid Before Paste
« Reply #9 on: May 10, 2022, 04:07:10 pm »
How did you get the value of counter? Please debug your code to find out its value.

And copy getter should return false to skip the column while copying.

Punit

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Modify Copied Column From pqgrid Before Paste
« Reply #10 on: May 12, 2022, 02:04:43 pm »
Hi,
Is there any way or event that executes after a complete copy event?. I want to reset the counter after columnTemplate event.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6122
    • View Profile
Re: Modify Copied Column From pqgrid Before Paste
« Reply #11 on: May 12, 2022, 04:33:43 pm »
There is no copy related event. May I know what you are trying to do.

Punit

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: Modify Copied Column From pqgrid Before Paste
« Reply #12 on: May 12, 2022, 05:06:09 pm »
We are developing excel mapping functionality in which users are able to skip some columns from a financial excel sheet. So I am skipping columns conditionally by increment counter. I want to Reset this counter after the complete copy event.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6122
    • View Profile
Re: Modify Copied Column From pqgrid Before Paste
« Reply #13 on: May 12, 2022, 05:12:40 pm »
What is the condition for skipping columns from end user perspective.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6122
    • View Profile
Re: Modify Copied Column From pqgrid Before Paste
« Reply #14 on: May 13, 2022, 12:15:44 pm »
Often there are multiple ways to solve the same problem.

So what I'm asking is what is the end user requirement you are trying to solve so that we find an alternative solution.