Copy Cell value from one Row to another

Have a Look at the example here https://stackblitz.com/edit/angular-enpmub-jefc9i?file=app.component.ts . My requirement is I have 2 Nodes under which I have different countries. User can click on any country from with project to add copy of that country into without project.

Try right click on Canada and it will create 2 rows one in with Project and another in without project. which is working okay. However In my development environment I am getting below error


Now, I would like to copy Date from one row to another row. Which is partially working okay. But I have noticed that in flatData. I am not getting correct ID. Somehow I am getting ID of 100 in with project and without project.




5 Replies

PS Pon Selva Jeganathan Syncfusion Team April 13, 2022 03:35 PM UTC

Hi Parth,


Thanks for contacting syncfusion forum.


Query: However In my development environment I am getting below error


We checked your shared sample, and run with development environment. But we were unable to reproduce the issue at our end.


Please refer to the below sample:

https://www.syncfusion.com/downloads/support/directtrac/general/ze/my-app311434058


Still if you are facing any issue, kindly get back to us with the below requested details,


  1. Share the product details version.
  2. Share the issue reproducible sample or reproduce the issue in our shared sample.


The provided information will be helpful to provide you response as early as possible. 


Query:  But I have noticed that in flatData. I am not getting correct ID. Somehow I am getting ID of 100 in with project and without project.


Based on your query, we suspect that you want to show the same ID value in both with project and without project. In your sample, you are set the primary column as ID field. In that case, you need to use the unique value. Otherwise if you are facing the issue while performing the CRUD operation, or other operation performed by using the primary key value.


If we misunderstand your query, kindly share the detailed explanation of your requirement or share the video demo of your requirement.


Kindly get back to us for further assistance.


Regards,
Pon selva




PD PDev April 14, 2022 12:24 PM UTC

Also, Solution provided is missing 



PD PDev April 14, 2022 12:25 PM UTC

Solution you gave is not compiling. app.component.ts is missing I guess

As you can see below, I have written the code which take care of unique ID, My issue is after which when I see flatdata collection. I see 100 ID in with and without project. But if I save that in database and then reload the page. It shows proper IDs that are 100 and 101.


Also, I want to copy Product Launch Date from With Project To without Project based on country/row for with Project.


Hope



FS Farveen Sulthana Thameeztheen Basha Syncfusion Team April 15, 2022 12:35 PM UTC

Hi Parth Rawal,


We will check the reported problem(app.Component.ts) file missing at our end and get back to you with further details for the reported queries by on or before 19th April 2022. Until then we appreciate your patience. In the meanwhile we will contact you if any details required.


Regards,
Farveen sulthana T



PS Pon Selva Jeganathan Syncfusion Team April 19, 2022 04:38 PM UTC

Hi Parth,


Thanks for your patience.


Query: However In my development environment I am getting below error


Sorry for the inconvenience.  We added the app.component.ts file.


Please refer to the below sample:

https://www.syncfusion.com/downloads/support/directtrac/general/ze/copypaste-344510962


Query:  I have written the code which take care of unique ID, My issue is after which when I see flatdata collection.


Based on your query, we suspect that you are facing the issue in flatData collection(i.e The data’s ID is changed properly in UI level, but the flat data collection same ID value shown in both the with and without project’s child records)


The parent Item value is not taken properly, so this issue occurred. Both the IDs has same parentItem details. In actionComplete event, you are changing the cell value using setCellValue method. After executing this method, the ID value is changed on flatData. To avoid this issue, we suggest you use the settimeout function while adding the without project data .


Please refer to the below code snippet,


setTimeout(() => {

      if (

        treegrid.flatData.filter((_) => _['ID'] == 53).length >

        0

      ) {

        let index1: any = treegrid.flatData.filter(

          (_) => _['ParentItem'] == 53 && _['name'] == withoutProjData['name']

        )[0]['index'];

        treegrid.addRecord(withoutProjData,  index1-1, 'Below');

      } }, 100);

    }

 


Please refer to the below screenshot,




Query:  I want to copy Product Launch Date from With Project To without Project based on country/row for with Project.


We are unclear about your query. We need some more additional details. Please share the below details.


  1. Confirm whether you are copying the productLaunchdate value from the selected record’s date value or the modified record’s date value.(i.e from your shared screen shot you are copying the date value from ID 100 or ID 39)
  2. Share the detail explanation of your requirement.
  3. Share the screenshot/ video demo of your requirement


Kindly get back to us for further assistance.


Regards,
Pon selva



Loader.
Up arrow icon