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
125
Inserting row using javascript wipes out existing row.
posted

Hi,

I'm using the UltraWebGrid version 4.3.20043.1142. I need to insert a row above an existing row using javascript. Here is the code I currently have:

 // this is inside a mouse or keyclick handler or whatever...
            var row = igtbl_getActiveRow("myGrid");
            var newrow = igtbl_addNew("myGrid", row.Band.Index);
            var grid = igtbl_getGridById("myGrid");
            grid.Rows.remove(grid.Rows.length-1);     
            grid.Rows.insert(newrow, row.getIndex());
            igtbl_setActiveCell("myGrid", newrow.getCell(1).Element);   
            igtbl_EnterEditMode("myGrid");

This works great on the client. The row is inserted, all the existing rows move down and I can enter text into the new row. The problem is when I save and the post happens. In the Page_Load, the inserted line is there but the line below it is gone. It looks like the new line wrote over the current line.

For example, here is the initial data in the grid:
Arizona
California
Nevada

this is how it looks after the javascript executes and I enter some text in the new row:
Arizona
Oregon
California
Nevada

but here is what I see in the Page_Load after the post:
Arizona
Oregon
Nevada

 Any help is greatly appreciated.

Parents
No Data
Reply
  • 45049
    posted

    You're using NetAdvantage 2004 Volume 3, which is a pretty old version of the toolset.  If I remember right, inserting rows on the client (as opposed to just adding them) didn't pass any information back on the server in this version.  I think, but am not absolutely certain, that this was added in either 2005 Volume 3 or 2006 Volume 1, or at least somewhere in that timeframe.

    While I don't myself know of any workarounds, perhaps someone else may be able to suggest ideas.

Children