problem after insert

Last post 05-04-2009 8:52 AM by TechGirl. 11 replies.
Page 1 of 1 (12 items)
Sort Posts: Previous Next
  • 04-27-2009 4:24 AM

    • TechGirl
    • Top 50 Contributor
    • Joined on 03-16-2009
    • Wannabe Slacker
    • Points 441

    problem after insert

     hi all

    I made an insert to the grid. after the insert , when I want to update the newly added row, I press the edit button and the new line disapear

    after refresh it workes fine(when added from server)

     

    second [roblem that after new row is added, the sort doesn't work well. it work manualy, but not after the webservices returned.I mean it is added to the buttom of the table, and stay there even though I call :sort()

  •  Advertisement

    Featured Advertisement

     
  • 04-27-2009 6:51 AM In reply to

    Re: problem after insert

    TechGirl:

    I made an insert to the grid. after the insert , when I want to update the newly added row, I press the edit button and the new line disapear

    after refresh it workes fine(when added from server)

    how do you insert the record in grid? (using any form/page or direct thru gridview?)

    do you refresh the grid (rebind) after inserting the record?

     

     

    "I would love to change the world, but they won’t give me the source code"

    Don't forget to click "Mark as Answer" on the post that helped you.
    This credits that member, earns you a point & mark your thread as Resolved for the sake of Future Readers.

    KaushaL || BLOG || Profile || Microsoft MVP
  • 04-27-2009 7:55 AM In reply to

    • sonu
    • Top 10 Contributor
    • Joined on 05-22-2006
    • Montreal / Canada
    • Slacker
    • Points 12,183
    • MVP

    Re: problem after insert

    Can you post your formatted insert code?

    [MVP since 2005] [MCAD]
    Webmaster of DotNetSlackers
    Question or Suggestion?
    Feel free to ask my any .NET question
    Our Posting FAQ
  • 04-30-2009 1:55 AM In reply to

    • TechGirl
    • Top 50 Contributor
    • Joined on 03-16-2009
    • Wannabe Slacker
    • Points 441

    Re: problem after insert

     

     

    function InsertSuccess(article) {

     

    CleanScreen();

     

    var data = new Array();

    data[0] = {//here is the data content};

    _gridView.insertRows(data);

    alert(

    "succses");

    SortByDescStartDate();

    }

     

    am I suposed to update from server? I thought part of the fun is there is no need to update all the grid again

    thanks

  • 04-30-2009 8:03 AM In reply to

    • sonu
    • Top 10 Contributor
    • Joined on 05-22-2006
    • Montreal / Canada
    • Slacker
    • Points 12,183
    • MVP

    Re: problem after insert

    The insertRows function adds/inserts the rows only on the clientside. There control doesnt know how to update the server. To answer your question: Yes, you have to update the server (if required).

    [MVP since 2005] [MCAD]
    Webmaster of DotNetSlackers
    Question or Suggestion?
    Feel free to ask my any .NET question
    Our Posting FAQ
  • 04-30-2009 8:48 AM In reply to

    • TechGirl
    • Top 50 Contributor
    • Joined on 03-16-2009
    • Wannabe Slacker
    • Points 441

    Re: problem after insert

    my problem is only in the client side. I update the server myself. all the problems I wrote here are client side problems 

  • 04-30-2009 9:06 AM In reply to

    • sonu
    • Top 10 Contributor
    • Joined on 05-22-2006
    • Montreal / Canada
    • Slacker
    • Points 12,183
    • MVP

    Re: problem after insert

    I am sorry, however I do not understand the problem. Few posts back, you said:

    "am I suposed to update from server?"

    What problems are you facing on the client-side?

    [MVP since 2005] [MCAD]
    Webmaster of DotNetSlackers
    Question or Suggestion?
    Feel free to ask my any .NET question
    Our Posting FAQ
  • 05-03-2009 1:58 AM In reply to

    • TechGirl
    • Top 50 Contributor
    • Joined on 03-16-2009
    • Wannabe Slacker
    • Points 441

    Re: problem after insert

     "am I suposed to update from server?"- I ment to refresh the grid since updating from client side didn't work

    when I refresh the grid the insert works

    when I add to the grid, the line is seen, but I can not update the nw inserted line and the grid is not sorted the way it should.

  • 05-03-2009 5:03 PM In reply to

    • sonu
    • Top 10 Contributor
    • Joined on 05-22-2006
    • Montreal / Canada
    • Slacker
    • Points 12,183
    • MVP

    Re: problem after insert

    What do you mean with that you can not update the new inserted line?

    The new row will always be added as the last row into the control. The sorting is not done automatically - its manually and left to the users.

    [MVP since 2005] [MCAD]
    Webmaster of DotNetSlackers
    Question or Suggestion?
    Feel free to ask my any .NET question
    Our Posting FAQ
  • 05-04-2009 1:57 AM In reply to

    • TechGirl
    • Top 50 Contributor
    • Joined on 03-16-2009
    • Wannabe Slacker
    • Points 441

    Re: problem after insert

     here is what I do

    _gridView.insertRows(data);

    alert(MSG_SUCCESS);

    Sort();

    -------------

     

    I insert the  new row to the client

    I call the sort function

    I edit the new row to edit the information

    --------------

    the problems:

    1.the new line is not sorted,even though I call the sort function

    2.I can not edit the new line

     

     

     

  • 05-04-2009 7:56 AM In reply to

    • sonu
    • Top 10 Contributor
    • Joined on 05-22-2006
    • Montreal / Canada
    • Slacker
    • Points 12,183
    • MVP

    Re: problem after insert

    How does your sort function look?

    [MVP since 2005] [MCAD]
    Webmaster of DotNetSlackers
    Question or Suggestion?
    Feel free to ask my any .NET question
    Our Posting FAQ
  • 05-04-2009 8:52 AM In reply to

    • TechGirl
    • Top 50 Contributor
    • Joined on 03-16-2009
    • Wannabe Slacker
    • Points 441

    Re: problem after insert

     

     

    function Sort(sender, e)

    {

    _gridView.set_sortColumn(e.get_sortColumn())

    _gridView.set_sortOrder(e.get_sortOrder());

    _gridView.set_editIndex(-1);

    LoadArticles();

    }

     

    Please note that I can not also edit the line(I.E press the edit button -the line just disapear)

Page 1 of 1 (12 items)