vladimir

Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Author
    Replies
  • in reply to: Auto-resizing of the leading column #123812
    vladimir
    Participant

    Greetings,

     

    Sorry for a late response, I was on a short vacation.

     

    Thank you for adding the resizeColumn method, it works great!

     

    Cheers!

    in reply to: Auto-resizing of the leading column #123810
    vladimir
    Participant

    That would be amazing! Thank you.

    in reply to: Auto-resizing of the leading column #123806
    vladimir
    Participant

    Hello Will,

     

    the events are working great. Could you just tell me what’s the proper way to set the column width dynamically?

     

    So far I have been just using CSS, but then

     

    $(“#grid”).trigger(“resize”)

     

    ignores the new width. I have tried with

     

    $(“#grid”).jqGrid(‘setColProp’, ‘position’, { widthOrg: newWidth, width: newWidth });

     

    but that results in a larger width than expected.

     

    I saw there’s a plugin for this by Oleg: https://github.com/OlegKi/jqGrid-plugins/blob/master/jQuery.jqGrid.setColWidth.js

     

    Should I maybe use that plugin?

     

    Thank you!

    • This reply was modified 11 years ago by vladimir.
    in reply to: Auto-resizing of the leading column #123802
    vladimir
    Participant

    Great. Thank you for the prompt addition.

     

    Will let you know how it goes.

    in reply to: Auto-resizing of the leading column #123800
    vladimir
    Participant

    … The problem with the above technique and on-demand loading is that we are unable to attach to “.tree-minus” and “.tree-plus” elements outside of an event that gets called every time a row is expanded (like jqGridAfterLoadComplete), resulting in the width adjustment function getting called multiple times for a single click and giving the wrong result.

    This is exactly what we plan to do – to define a events when the plus or minus icons are clicked.

    Kind Regards,

    Will

    Sounds great.

    in reply to: Auto-resizing of the leading column #123799
    vladimir
    Participant

    Sorry for bad formatting. I’m not sure how you add a break with this editor.

    Switch to visual mode (upper right corner) in order to put line breaks

    Kind Regards,

    Will

    Thank you.

    in reply to: Auto-resizing of the leading column #123792
    vladimir
    Participant

    Sorry for bad formatting. I’m not sure how you add a break with this editor.

    in reply to: Auto-resizing of the leading column #123789
    vladimir
    Participant

    Thank you for the response Will,

    Yes, auto-resize sounds like what’s needed.

    We managed to achieve this with a TreeGrid that has all the “child” rows loaded on page load (not on-demand), by binding to the “click” event of the “.tree-minus” and “.tree-plus” elements, and manually calculating and setting the width based on the highest level in the grid.

    Since we have pretty large data tables, we need to load child rows on-demand.

    The problem with the above technique and on-demand loading is that we are unable to attach to “.tree-minus” and “.tree-plus” elements outside of an event that gets called every time a row is expanded (like jqGridAfterLoadComplete), resulting in the width adjustment function getting called multiple times for a single click and giving the wrong result.

    Unfortunately calling something like:

    $(“body”).on(“click”, “.tree-plus, .tree-minus”, function() { doStuff() });

    outside a TreeGrid event doesn’t work.

    We are also unable to call .off() before .on(), in the event, since that removes your internal code for actually expanding and loading child rows via Ajax.

    • This reply was modified 11 years ago by vladimir.
    • This reply was modified 11 years ago by vladimir.
Viewing 8 replies - 1 through 8 (of 8 total)

Stay connected with us in your favorite flavor!