Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
75
Javascript equivalent of CopyFrom
posted

Hello,

 I'm working on an application which requires that, when clicked, clientside code will add a new row to the grid based on the first pre-populated row.

The new row will be a duplicate of the first row.  Setting the data is not difficult but I am having issues with templated columns which seem to be ignored by the addNew method (both grid.Bands[0].addNew() and igtbl_addNew()).

 Ideally, I would like to be able to do what CopyRow does but through javascript. 

If there is no JS equivalent to CopyRow, is there a way to make sure the templated columns are repeated, even if I have to code this manually?

  • 100
    posted

    Hi eyetie,

    I have a similar problem. Did you find any solution for that?

    Your help would be much appreciated,

    Christophe

  • 28464
    posted

    Hello,

    Thanks for writing. I am not sure that we have something that matches this requirement 100%. Still, this might be possible to implement to some extent using the CSOM (Client Side Object Model) of the grid.

    I guess a good starting point is out help documentation for the client-side Row object:

    http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR3.5/html/WebGrid_row_Object_CSOM.html 

    While I do not see anything the clones a row there, maybe going through all the cells (using getCell()) and then replicating that in the new row could do the trick?

    Another idea - our customers often share great code in the forums, so maybe going through a forum search for getCell and browsing some of the solutions there may provide additional clues.

    http://forums.infragistics.com/search/SearchResults.aspx?q=getCell

    Hope this helps.