N@Z

Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • in reply to: How to show an icon in a jqGrid cell ? #102292
    N@Z
    Participant

    thank you very much, Romyn, your code helped me as well.

    N@Z
    Participant

    OK, it seems i solved the problem.

    in case it halps someone else:

    1) in teh file activity_get1.php I added the code that checks if id==0 and in that case i print an empty SELECT

    if($id == 0)
    {
    echo “”;
    }

     

    2) in the event onSelectRow, before placing the row in edit mode, I added the following code:

    $(“#” + subgrid_table_id).setColProp(‘HID_ACT_id’, { editoptions: { dataUrl:’activity_get1.php?id=’ + rowId }});

    so in the file activity_get1.php I can retrieve the value of the column HID_CDC_id saved in the database (this because i don’t care about the changes of that SELECT because they are already managed in the relative part of code)

     

    3)then i removed all the other parts of code that worked with the select HID_ACT_id in particular i removed all the following code:

     $.get(‘activity_get1.php?id=’ + rowId, function(data) {

                 var res = $(data).html();

                 var select_id = “#” + rowId + “_HID_ACT_id”;

                //alert(res);

                $(select_id).html(res);

              });

     

    anyway thanks for the support tony! great plugin!!!

    N@Z
    Participant

    First of all thanks for your reply.

    I read the code of the demo 10 times and tried to change many things in my code but I couldn’t get the solution… I didn’t get the point unfortunately.

    I think the problem is the inline editing because ad I can see in the demo if I used the “form” edit mode i’d be able to make the trick.

    I tried mostly everything but in any case SOMETIMES the code doesn’t reach the desired SELECT. (like 10% of times i click on a row to enter in edit mode the 2nd SELECT remains empty)

    I tried:

    jQuery(“#” + rowId + ‘_HID_ACT_id’).html(“”);
    jQuery(“#” + rowId + ‘_HID_ACT_id’).html(res);

    or

    $(“#” + rowId + ‘_HID_ACT_id’).html(res);

    or

    //this 10% of times i click gives me the error i posted above

    document.getElementById(rowId + ‘_HID_ACT_id’).innerHTML = res;

    or even

    $(“#” + subgrid_table_id).setColProp(‘HID_ACT_id’, { editoptions: { value: data} });

    or even

    setInterval(function() {$(select_id).html(res);}, 100);

     

    nothing solved the problem.

     

    please, help me becuse i’m stuck.

     

    PS. I even tried to remove the EDITOPTION from the column HID_ACT_id and populate it programmatically in the OnSelectRow event, but I can’t because without that part the SELECT doesn’t have an ID and therefore i cannot reach it.

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

Stay connected with us in your favorite flavor!