0

How can I capture event in Jquery EasyUI Panel:Region:west or region:center resize ? I need to refresh some content after center or east region is re-sized by user.

<div id="cc" class="easyui-panel" title="Nested Panel" style="height:200px;padding:10px;">
    <div class="easyui-layout" data-options="fit:true">
        <div id="dd" data-options="region:'west',split:true" style="width:100px;padding:10px">
            Left Content
        </div>
        <div id="ee" data-options="region:'center'" style="padding:10px">
            Right Content
        </div>
    </div>
</div>

How Do I capture Div dd or ee at above example ? Also following code only works on first load. doesn't work When resizing div dd or ee

<script>
$(document).ready(function () {
    $(function(){
        $('#cc').panel();
        $('#cc').panel({
            onResize:function(){
                alert("dd");
            }
        });
    });
});
</script>
django
  • 2,809
  • 5
  • 47
  • 80

2 Answers2

1

In case you're still looking for an answer, the following code allows me to save and restore the size of an easyUI layout panel:

$(document).ready(function() {
    var panel = $('#main-layout').layout('panel', 'south'),
        hsize = localStorage.getItem('SouthPanel_h');

    panel.panel({
        height: hsize > 0 ? hsize : 50,
        onResize: function(height,width) {
            localStorage.setItem('SouthPanel_h', height);
        }
    });
});
0

jQuery doesn't have such an event. You can try this.

http://benalman.com/projects/jquery-resize-plugin

Hallelujah
  • 28
  • 7