ashish.sharma

Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Author
    Replies
  • in reply to: SubGrid and records==0 #82135
    ashish.sharma
    Participant

    Thanks for your reply tony.

    I am using grid as a subgrid. But I am not able to find out how to stop the ajax call in case of no record. We just have loadComplete method and don’t have any beforeSend method where we can simply return false in case of no record.

    Here is the loadComplete method of my subgrid …

    =============================================

    loadComplete: function(){
    var ids2 = jQuery(“#”+subgrid_table_id).getDataIDs();
    if(ids2.length == 0) {
    $(“#”+subgrid_id).html(“No sub-category found.”);
    } else {
    for(var j=0;j<ids2.length;j++){
    var cl2 = ids2[j];
    edit = “”;

    be2 = “

    in reply to: SubGrid and records==0 #82128
    ashish.sharma
    Participant

    Hello,

    I would like that NO ajax call will be made in the sub-grid if we know that there is NO record to be displayed in the sub grid. I am using this grid in a Category section where I am displaying Parent in main and child in sub grid. Along with the parent name in main grid I am also displaying the count of child categories within the parent category. Here I don’t want to call the ajax to look for the sub categories where the count is 0. and instead of showing a blank sub grid I would like to dsplay a message like ‘No Record Found’ … An another best solution for such case would be that we should not allow sub grid expension in case of 0 record.

    Can anyone help me in this??

    Ashish

    in reply to: Row Editing Example #81924
    ashish.sharma
    Participant

    Hi,

    I would like to know, is there any way to add edit, delete buttons for subgrids like we add in loadComplete of main grid?

    Ashish

    in reply to: Row Editing Example #81923
    ashish.sharma
    Participant

    It’s working now! 🙂 ..thanks tony.

    I am able to update the information now using this new .js file.

    Thanks once again ..

    Ashish

    in reply to: Row Editing Example #81922
    ashish.sharma
    Participant

    It’s working now! 🙂 ..thanks tony.

    I am able to update the information now using this new .js file.

    Thanks once again ..

    Ashish

    in reply to: Row Editing Example #81916
    ashish.sharma
    Participant

    Tony,

    Thanks a lot for your quick reply. You have provided me gr8 support so far .. thx again.

    I’ll try to implement the same and get back to you in case of any other issue.

    Regards
    Ashish Sharma

    in reply to: Row Editing Example #81914
    ashish.sharma
    Participant

    Hello,

    Thanks a lot for your response

    My requirement is slightly different from your example as in this example the user have to calculate the total (of amount + tax) manually but in my case I am having a total column in my DB which is storing the sum of the entered amount and tax. Now i need to display that total from the DB. Basically I am able to save the data using the “saveRow” method but I am not able to reload the entire row data from the DB. I don’t think there is any way in this where I can load the data of a single row from the Db values .. correct me if I am wrong. So, an alternative solution which I thought will work is that updating the row data using “setRowData” method in the callback function. So, I have added a callback function named “checksave” in “saveRow” method as its 2nd parameter.

    See below ..

    se = “”;

    And as a result of the update query I have returned a complete string in the “checksave” function from my server.php. See below …

    $total = $_POST + $_POST;
    $response=$_POST.’^|^{amount:”‘.$_POST.'”,tax:”‘.$_POST.'”,total:”‘.$total.'”,note:”Updated …”}’;

    echo $response;

    As a result of the above lines, I am getting in my checksave function, is the rowID concatenated by “^|^” and then complete row data.

    Then I am using ..

    var resultData = result.split(‘^|^’); // split result to get the rowID in resultData [0] and data string in resultData[1].

    // Setting rowData
    var su=jQuery(“#rowed2”).setRowData(resultData [0],resultData[1]);

    “su” above is alerting “true” which i believe is returning after successful updation of rowData.

    But If, I am using getRowData() method to get the value of row on the basis of rowID stored in resultData[0] in my case, I am getting nothing its blank.

    Is there any other solution / alternative to get the work done?

    Thanks once again!

    Ashish

    in reply to: Row Editing Example #81912
    ashish.sharma
    Participant

    It’s really wonderful. But I am facing a problem while adding my requirement as In my case the total amount will be calculated automatically by adding the amount + tax. I think that this can be achieved using any method given below …

    1. Reloading the entire row data (getting that row again from the server using ajax)
    2. Reloading the complete grid, but in this case I have to take care of the current paging and sorting order.
    3. Updating the row data in a callback function using setRowData() .. -> I have tried this BUT it is NOT working.It is working if I pass a static rowID in the 1st param but it is not working when I am passing dynamic rowID + its data which I am getting as a result in my callback function.

    Can anyone help me in this !

    Thanks
    Ashish Sharma

Viewing 8 replies - 1 through 8 (of 8 total)

Stay connected with us in your favorite flavor!