pedroa

Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • in reply to: treegrid PHP Add and Edit does not update grid #125300
    pedroa
    Participant

    Thanks for the heads up.

    Have a nice day.

    in reply to: treegrid PHP Add and Edit does not update grid #125281
    pedroa
    Participant

    Hi Will,

     

    Thank you very much for the fix and this product my friend.

     

    Since what I have is the downloaded Guriddo_Suito_PHP_5_1_X, I don’t have that exact file from gitHub, but I found code on js/trirand/src/jquery.jqGrid.js

    line 8898:

     

    if(postdata[idname] == null || postdata[idname] === “_empty”){

     

    modified it to:

     

    if(postdata[idname] == null || postdata[idname] === “_empty” || postdata[idname] == “”){

     

    But, since the demos use the minified files, I changed js/trirand/jquery.jqGrid.min.js which is a bit trickier, but searching for $.jgrid.randId()),null (which can be found only one time in the file) will put you right next to where the change will go.

    So, line 14, column 29345, just add:

     

    ||””==s[c]

     

    or you can simply replace:

     

    $.jgrid.randId()),null==s[c]||”_empty”===s[c]

     

    with:

     

    $.jgrid.randId()),null==s[c]||”_empty”===s[c]||””==s[c]

     

    Then I replaced the last 2 lines of code from both treegrid.php files of the addeditdelete demo, and the adj_model demo, from:

     

    $tree->setNavOptions(‘navigator’, array(“add”=>true,”edit”=>true, “del”=>true, “search”=>false, “excel”=>false));
    $tree->renderTree(‘#tree’, ‘#pager’, true,null, null, true, true);

     

    with your new addeditdelete php demo code, to:

     

    $after = <<< AFTER
    function(data, postdata,oper) {
    var response = data.responseText.split(“##”);
    if(response[0]===’success’) {
    return [true,response[1],response[2]];
    } else {
    return [false,response[1]];
    }
    }
    AFTER;
    $tree->setNavOptions(‘navigator’, array(“add”=>true,”edit”=>true, “del”=>true, “search”=>false, “excel”=>false));
    $tree->setNavOptions(‘add’, array(“reloadAfterSubmit”=>false));
    $tree->setNavOptions(‘edit’, array(“reloadAfterSubmit”=>false));
    $tree->setNavEvent(‘add’, ‘afterSubmit’, $after);
    $tree->setNavEvent(‘edit’, ‘afterSubmit’, $after);
    $tree->renderTree(‘#tree’, ‘#pager’, true,null, null, true, true);

     

    And now both demos work locally as they should.

     

    Please note that you haven’t updated the adj_model php demo on your site.

     

    Cheers, and again thank you very much.

    • This reply was modified 9 years, 10 months ago by pedroa.
Viewing 2 replies - 1 through 2 (of 2 total)

Stay connected with us in your favorite flavor!