todo.js 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. $(function()
  2. {
  3. var $showdata = $('#showdata');
  4. $showdata.load($showdata.data('url') + ' #dataWrapper', function()
  5. {
  6. if($.fn.datatable)
  7. {
  8. $('#datatable').datatable({fixedLeftWidth: 200, scrollPos: 'out', customizable: false, sortable: false, mergeRows: true, fixedHeader:true, ready:function()
  9. {
  10. $('div.table-footer').css('width', $('#datatable-datatable').width());
  11. fixScroll();
  12. }
  13. });
  14. $('#dataWrapper .pager').pager();
  15. }
  16. });
  17. });
  18. /* Fix bug #20413. */
  19. $(window).resize(function()
  20. {
  21. $('div.table-footer').css('width', $('#datatable-datatable').width());
  22. $('div.datatable-rows .fixed-left tr').each(function(index)
  23. {
  24. var leftHeight = $(this)[0].getBoundingClientRect().height;
  25. var rightHeight = $('div.datatable-rows .flexarea tr').eq(index)[0].getBoundingClientRect().height;
  26. if(leftHeight < rightHeight) $(this).height(rightHeight);
  27. if(leftHeight > rightHeight) $('div.datatable-rows .flexarea tr').eq(index).height(leftHeight);
  28. });
  29. })