josepk

Forum Replies Created

Viewing 15 replies - 16 through 30 (of 34 total)
  • Author
    Replies
  • in reply to: Inline mode and session expired problem #82871
    josepk
    Participant

    Ok tony,

    I have sended you the grid.inline.js.

    thanks.

    Josep Escofet

    in reply to: Inline mode and session expired problem #82869
    josepk
    Participant

    If somebody wants de grid.inline.js modified ask me , and I send my

    copy with the problem of onerrorfunc solved(session expired,

    error saving on server) and with another

    function afterCancelFunc a callback function that is called when

    the ESC key is pressed on a row.

    josepk.basura@gmail.com

    thanks.

    Josep Escofet

    in reply to: Inline mode and session expired problem #82860
    josepk
    Participant

    The code is not all visible on the screen , there is some method for post the

    code correctly ?

    Tony, do you want to put this for all?

    thanks.

    Josep Escofet

    in reply to: Inline mode and session expired problem #82859
    josepk
    Participant

    Hi,

    I have finished the solution and I posted here, I put the full complet

    saveRow function, the only think that I have made is to change the

    call to $.post for $.call and clean some code not necessary.

    This functions resolves the problem of session expired when

    you are going to make a row to save and if there is a problem

    saving row on server and it responds with some error code

    (400, 404,500….) not 200 OK code.

    saveRow : function(rowid, succesfunc, url, extraparam, aftersavefunc,errorfunc) {

    in reply to: Inline mode and session expired problem #82858
    josepk
    Participant

    Hi Tony,

    I have found the solution, now I am cleaning the code and doing

    the last test… and after I will post the solution.

    The key is not to use $.post function becouse this function

    doesnt call the callback function in case of the response is not success,

    then if you use the $.ajax fucntion with onerror: callback function.

    I have tested the first solution and it works.

    When I finished the code I will post, perhaps later or tomorrow.

    this solution catches the session expired too.

    thanks.

    Josep escofet

    in reply to: Inline mode and session expired problem #82857
    josepk
    Participant

    Hi tony,

    I have look the code again and I think that your solution is

    wrong becouse the callback function is never called if the

    response of the server is not success, then the if into the function

    that says : if (stat === “success”){ is never called if the response

    is wrong becouse the callback function is never called.

    I have tested it and if the response is success the function is

    called, but if it is wrong (404, 500….) the function is never called,

    just put an alert before if (stat === “success”) and you will see that

    the function is never called.

    thanks,

    in reply to: Inline mode and session expired problem #82855
    josepk
    Participant

    I think that this is not the problem, with my last test , I

    have the session active, and I forced an error on every row

    save, with a header(404) or (500) and the function onerrorfunc

    is never called, then I look at inline.js and I have found :

    $.post(url,tmp,function(res,stat){ function on saveRow.

    I have looking at documentation on jquery and I have

    found that :

    This is an easy way to send a simple POST request to a server

    without having to use the more complex $.ajax function. It

    allows a single callback function to be specified that will be executed

    when the request is complete

    (and only if the response has a successful response code).

    then in case of error (404, 500,…) the onerrorfunc is never called.

    is it ok? Is it a bug?

    thanks.

    in reply to: Inline mode and session expired problem #82851
    josepk
    Participant

    I send again the functions.

    jQuery(grid).editRow(actualRow, true, null, errorAjaxServer,

    url, null, checkSave, onErrorServer);

    jQuery(grid).saveRow(actualRow, errorAjaxServer, url,

    null, checkSave, onErrorServer);

    function onErrorServer(rowid, result){

    in reply to: Inline mode and session expired problem #82849
    josepk
    Participant

    Hi Tony,

    I have been another test, when I modify a row and the row is saved to

    the server, I am throwing and error(404) with java

    ( response.sendError(404) ) and the onerrorfunc is not called.

    But my application detects it and send to the client a page with the custom

    error for 404, but the grid doesnt catch it.

    I am calling the onerrorfunc :

    jQuery(grid).editRow(actualRow, true, null, errorAjaxServer, url, null, checkSave, onErrorServer);

    jQuery(grid).saveRow(actualRow, errorAjaxServer, url, null, checkSave, onErrorServer);

    function onErrorServer(rowid, result){

    in reply to: How to trigger custom error to fire up loadError #82738
    josepk
    Participant

    In our project , we utilize struts and Jsp, j2ee, java, and when an error

    ocurs we dont generate any http header error, we are calling the same

    page that has generated the error but with some message in a div.

    Then when the server responds and the grid method are called, the

    response of the server can be catched and parsed to see if there is an

    error and then

    in reply to: Intercepting ESC key in inline Mode : Done #82640
    josepk
    Participant

    Hi,

    I am adding the full grid.inlinedit.js becouse can it be difficult for newbies to

    modify this.

    I add too the call to the edit row, if the edit it is cancelled, the function

    checkCancel2 will be called, it can be util for example if you want buttons that appear and disappear relative to the real possible operations and dont

    have all buttons always displayed for possible operations not applicable at certain momment.

    //

    in reply to: Sortable, reloadgrid and loadonce=true problem #82639
    josepk
    Participant

    Thanks tony,

    I have made the sort at the server side, and now it is working perfectly.

    thanks a lot.

    Josep Escofet

    in reply to: Sortable, reloadgrid and loadonce=true problem #82637
    josepk
    Participant

    thanks Tony,

    But if you put loadonce=true the data is sorted when you click some col,

    is it done for the javascript in the client side?

    Josep Esofet

    in reply to: Sortable, reloadgrid and loadonce=true problem #82634
    josepk
    Participant

    This data is a sample constructed from server, Struts action populates a

    List and the list is putted on session and after there is a jsp file that renders

    this list as xml file. The original data comes from database thru sql, but

    too it is putted on list and after there is a jsp file that renders this data.

    An example with original data is here :

    in reply to: Sortable, reloadgrid and loadonce=true problem #82632
    josepk
    Participant

    Hi Tony,

    I have tested your solutions but it not work for me.

    When It is default option loadonce:false, every time that I click in one

    column it is calling to server and asking the file.xml of the rows, the server charges the file correctly but it is not ordered.

    When I put loadOnce:true , every time I click the column the list is displayed ordered, but not is calling to server for refreshing data. I have tryed too

    put loadOnce:true and when the user push a button :

    $(”#mygrid”).setGridParam({loadonce:'false'}).trigger(”reloadGrid”)

    but it is not calling to the server for refreshing data.

    I send you the jQgrid defiition and the xml file. I dont understand what is happening.

    jqgrid definition:

    jQuery(document).ready(function(){

Viewing 15 replies - 16 through 30 (of 34 total)

Stay connected with us in your favorite flavor!