Author Topic: Pasted Data Not Reflecting in Empty Grid  (Read 986 times)

Suhasini Birge

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 28
    • View Profile
Pasted Data Not Reflecting in Empty Grid
« on: January 06, 2021, 04:18:49 pm »
Hi Paramvir,

https://paramquery.com/pro/demos62/copy_paste

I'm following the above mentioned demo to  :

copy one or more rows from excel and then pasting it in a grid with 9 columns(colModel defined)
then I want to save those pasted rows using the addList.

However, the pasted rows are not getting reflected in the grid and is giving the below error message on console:

Code: [Select]
Uncaught TypeError: f.forEach is not a function
    at t.<computed>.<computed>.a._digestData (pqgrid.min.js:10)
    at i.cExcel.paste (pqgrid.min.js:14)
    at pqgrid.min.js:14

I'm getting the pasted rows information in the beforePaste event in an array.

Unable to generate a jsfiddle as all jsfiddle example is showing $ undefined error.

Thanks,
-Uttam


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 5228
    • View Profile
Re: Pasted Data Not Reflecting in Empty Grid
« Reply #1 on: January 06, 2021, 06:08:04 pm »
[ Only Pro members may read this post. ]

Suhasini Birge

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Pasted Data Not Reflecting in Empty Grid
« Reply #2 on: January 06, 2021, 10:11:10 pm »
Hi,

Please check the jsfiddle below, managed to get one  ;)

https://jsfiddle.net/k8gfrwd1/1/

The pasted rows are now reflecting in the empty grid.
However, the isDirty flag is not changing to true and thus I'm unable to save the values in the database with the SaveChargeCodeManager method.

How can this be done?
Is there any other way through which I can save the pasted values from the empty grid to the database?

Thanks,
-Uttam

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 5228
    • View Profile
Re: Pasted Data Not Reflecting in Empty Grid
« Reply #3 on: January 07, 2021, 12:49:45 pm »
[ Only Pro members may read this post. ]

Suhasini Birge

  • Pro Enterprise
  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Pasted Data Not Reflecting in Empty Grid
« Reply #4 on: January 07, 2021, 01:11:43 pm »
Hi,

I want the grid to be like a workspace, i.e., I'll be pasting the data after copying it from excel and then saving those data in the database.
Once those values get saved, I want the grid to be empty or blank again.

Will recIndx work in this scenario where I don't want to fetch any data and display in the grid?
All I want it for pushing records into the database.

Thanks,
-Uttam

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 5228
    • View Profile
Re: Pasted Data Not Reflecting in Empty Grid
« Reply #5 on: January 07, 2021, 02:02:55 pm »
[ Only Pro members may read this post. ]