HZNM.COM
welcome to my space
X
Search:  
 HOME   problem while displaying data on gird after save
problem while displaying data on gird after save
Published by: webmaster 2010-03-18
Welcome to:hznm.com

  • hi,

    I am trying to save the changes of the Editor grid panel into database...
    For implementing this am using ..

    var strJSON = Ext.encode(data);

    strUrl = 'service/editAllSave?strjson=' + strJSON;

    Ext.Ajax.request({
    url: strUrl,
    success:function(response,options){

    Ext.MessageBox.alert("Message", "Successfully Saved");
    var o = Ext.util.JSON.decode(response.responseText);//passed back from server
    var records = grid.getStore().getModifiedRecords();
    Ext.each(records, function(r, i) {
    if(o.insertIds && o.insertIds[i]) {
    r.set(this.idName, o.insertIds[i]);
    }
    });
    grid.getStore().commitChanges();
    },

    failure: function() {
    Ext.MessageBox.alert("Error", "Something Fail on Save");
    }
    });

    The data is getting saved into database but when displaying the Editor Grid panel back, the edited cells are still having the red triangle within them.
    RSS DAILY WORLD NEWS-Tinklenbergs on the air::
    After reporting that, Ive gotten lots of clues from people here and on Twitter This economically dire situation, while blamed on Republicans with good reason,
    http://www.mikmuk.com/news/9872
    HOME

    I am using Mozilla.
    In the console its giving as

    syntax error ()

    When I am checking the response through Net --> XHR --> Response tab ..its showing as "Loading........" but the data is not at all loading.

    If I click on the console error ......
    in the script tab its pointing to this

    this.decode = function(json){
    return eval("(" + json + ')');
    };

    please help me ..I am not able to understand what is the prob ??/


  • You appear to have some server side error where it is sending back malformed json.


  • In firebug console there should be a line associated with your XHR. There is a response tab. That tab only displays "load...", or does it have more content?

    Server side help is really beyond the scope of this forum, ext doesn't care what your backend is, just that the data come through in proper XML or JSON format.

    If you know how to load the initial data in your grid then you must know how to send the data back. So I'd guess you have some malfunction in your saving routine where you're not reading or writing properly.


  • thanx for the reply. But how to get that resolve or how could I find what is the problem at my server side.


    Here is my back end code.

    public void saveEditAllToDatabase(HttpServletRequest request, HttpServletResponse response) throws IOException {

    String strJson = request.getParameter("strjson");

    In the request the JSON string would be in the format ==>
    strjson [{"part@AutoUp":"OFF","part@autoseq":"113037","part@my":"2008","part@pnum":"06101448","part@prc":"00","part@src":"VA","part@addop":"","part@dst":"WP","part@ufmy":"Y","updateSource":"EditMany (part@AutoUp)"}]
    ...................
    .................
    ................
    Am parsing the JSON string and inserting the data into database.

    }

    Please help...I am stuck up with my deliverables :s





  • Challenging Books For A 14 Year Old?
    First guitar : acoustic or electric?

    You are looking at:hznm.com's problem while displaying data on gird after save, click hznm.com to home
     
     Homepage | Add to favorites | Contact us | Exchange links | LOGIN | Site map | 
    Copyright© 2008 hznm.com        Site made:CFZ