jQWidgets Forums

Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts

  • ei7024
    Participant

    Created a simple JSFiddle to show: http://jsfiddle.net/ei7024/acjhz/13/
    Custom toolTip applied to first column!

    in reply to: cellhover documentation cellhover documentation #69487

    ei7024
    Participant

    I was also looking for the same information and came across this posting. If what u say above is the case then what about this post?
    http://www.jqwidgets.com/community/topic/grid-tooltip/#post-46399 and this method is still applicable.


    ei7024
    Participant

    Thanks for the help! It would have taken me a while to reach the same conclusion!

    in reply to: Confirmation on editing the grid Confirmation on editing the grid #59452

    ei7024
    Participant

    btw gonley I think this may come in handy as a solution;

    
    if (!oldvalue) {conf = true;} else {conf = confirm('Are you sure ?');}
    if(conf == true) 
    { // IF TRUE
      alert(newvalue);
      return newvalue;
    } else 
    {
      // IF FALSE - SHOW OLD VALUE
      alert(oldvalue);
      return oldvalue;
    }

    the above code is added in the cellvaluechanging: function (row, column, columntype, oldvalue, newvalue) { //ABOVE CODE }
    and then your code to update or not in the $(“#jqxgrid”).on(‘cellendedit’, function (event) {}

    If the user clicks cancel then the cellendedit will have newvalue = oldvalues…..

    Hope it helps!

    in reply to: Confirmation on editing the grid Confirmation on editing the grid #59449

    ei7024
    Participant

    I was about to post a same request and would also like to know the answer to this question please!

    In my case the cellendedit function is called at the time of select in the initeditor: function ()

    editor.on('select',function(){ $("#jqxgrid").jqxGrid('endcelledit', row, "datafield", false);});

    the following is the cellendedit function()

    $("#jqxgrid").on('cellendedit', function (event) {
        var column = args.datafield;
        var row = args.rowindex;
        var value = args.value;
        var oldvalue = args.oldvalue;
        
        r = -1;
        
        if(oldvalue != '')
        {
            conf = confirm('Are you sure?');
        }
        else
        {
            conf = true;
        }
        
        if(conf)
        {
            //PROCEED WITH CHANGES AND REFRESH GRID
        }
        else
        {
            //CANCEL REQUEST AND SET COLUMN TO OLD VALUE
            $("#jqxgrid").jqxGrid('setcellvalue', row, column, oldvalue); //<------DOES NOT SET THE VALUE
        }
        
        alert(oldvalue + '---->' + value);
    });

    ei7024
    Participant

    Okay I managed to fix it…It now work as i intended it to the same principle as the OP had in mind. You can find the code here. It commented at the last few lines


    ei7024
    Participant

    Hi Peter,

    I was going to create a similar thread but though on continuing this as it may also prove beneficial to the OP. Now to the main reason, I am not sure if there was an error in the way I designed the function or not but I have come across an issue and not sure how to rectify it. The issue occurs only when a filter of some sort has been applied! I have modified the previous code here. If you apply a filter to the first name, I tried ‘an’, you will observe that the first 3 records may collapse fine but the last record will not! But if the filters are cleared there will be no issue.

    The only thing i noticed was the (selectedrowindexes: [event.args.rowindex]) does not select the row that are visible.

    Any input will be appreciated!

    Thanks,

Viewing 7 posts - 1 through 7 (of 7 total)