EasyUI Forum
May 14, 2024, 02:42:07 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: [1] 2
1  General Category / General Discussion / Re: Save datagrid rows to database on: September 24, 2012, 06:42:49 PM
Something like that
Code:
    var rows = tbl.datagrid('getRows');
    $.each(rows, function(i, row) {
      $.ajax("/api/data.balance.data/", {
        type:'POST',
        dataType: 'json',
        data:row
      });
    });
2  General Category / General Discussion / Re: Plug in for jquery-easyui on: September 24, 2012, 06:36:27 PM
IMHO nothing interesting, unreadable hierarchy
3  General Category / EasyUI for jQuery / Re: dynamically created splitbutton and subitems on: September 24, 2012, 06:34:00 PM
Something like that
Code:
$('#mm').menu('appendItem', {
text: 'New Item',
iconCls: 'icon-ok',
onclick: function(){alert('New Item')}
});
4  General Category / EasyUI for jQuery / Re: issue in treegrid on: September 24, 2012, 06:31:53 PM
1.
If ajax query not send then error occurred in ajax invoking code or previous lines
possible here
Code:
searchData = { 'id': _txtdbid, 'filename': _txtdocname, 'doctype': _txtdoctype};
_txtdbid  etc. is global variables, accesible from this context?

2.
Browser contains support of JSON object (JSON.stringify) ?

3.
What output in error console?

4.
Code:
document.getElementById('grayOut').style.display = "none";
//Same
$('#grayOut').hide();

5.
For bettre performance call selector once
Code:
var tree = $('#test');
tree.treegrid('loading');
...
tree.treegrid('loadData', jQuery.parseJSON(data.d));
enableDnd(tree);
tree.treegrid('loaded');
5  General Category / EasyUI for jQuery / Re: issue in treegrid on: September 24, 2012, 06:07:27 AM
Also  show the code of function loadSearchData, may be you using .datagrid  property inside
6  General Category / EasyUI for jQuery / Re: issue in treegrid on: September 24, 2012, 06:03:38 AM
Try
Code:
var opts = $('#dg').datagrid('options');
opts.pageNumber = 1;
loadSearchData(1, opts.pageSize);
7  General Category / General Discussion / Re: Menu: feature request on: September 14, 2012, 07:06:25 AM
Please review  rewritten menu plug-in.

Rewrited piece
Code:
    function wrapMenu(menu) {
      // Tmp is element for text width calculation
      var tmp = $('<div/>').addClass('menu').css({
        visibility:'hidden'
        }).appendTo('body');
      // Tmp variable contains maximum item width
      var autoWidth = 0;
      menu.addClass('menu').find('>div').each(function() {
        var item = $(this);
        if (item.hasClass('menu-sep')) {
          item.html('&nbsp;');
        } else {
          // the menu item options
          var itemOpts = $.extend({}, $.parser.parseOptions(this, ['name', 'iconCls', 'href']), {
            disabled: (item.attr('disabled') ? true : undefined)
          });
          item.attr('name', itemOpts.name || '').attr('href', itemOpts.href || '');
          var text = item.addClass('menu-item').html();
  // Fill tmp
          tmp.html(text);
  // Get width + left offset + arrow width
          var itemWidth = tmp.width() + 28 + 22; // + Left offset + arrow width
  // If width greater than previous, replace width
          if (autoWidth < itemWidth) {
            autoWidth = itemWidth;
          }

          item.empty().append($('<div class="menu-text"></div>').html(text));
          if (itemOpts.iconCls) {
            $('<div class="menu-icon"></div>').addClass(itemOpts.iconCls).appendTo(item);
          }
          if (itemOpts.disabled) {
            setDisabled(target, item[0], true);
          }
          if (item[0].submenu) {
            $('<div class="menu-rightarrow"></div>').appendTo(item); // has sub menu
          }
          item._outerHeight(22);
        }
      // Remove tmp element
      tmp.remove();
      // Apply autowidth
      menu.css({width:autoWidth});
      menu.hide();
    }
  }
8  General Category / General Discussion / Menu: feature request on: September 12, 2012, 07:53:30 AM
Current version requires set width for menu? can you add autosize calculation?
Please reffer idea
http://jsfiddle.net/2rVwN/2/
http://jsfiddle.net/2rVwN/3/
9  General Category / News / Re: jQuery EasyUI 1.3.1 Release on: September 12, 2012, 07:15:40 AM
1.3.1 archive contains src folder with some sources? it's bug? =)
10  General Category / Bug Report / Re: DataGrid colspan bug on: September 12, 2012, 07:05:32 AM
But this hack, is not solution.
I checked other look-like code, everywhere when summary width of bottom columns greater then top columns, we get same bug.

May be once at table creattion when column width undefined - calc autosize?
Code:
var tmp = $('<div/>').css({display:'inline',visibility:'hidden'}).text('Restructured outdated').appendTo('body');
var autoSize = tmp.width();
tmp.remove();k
11  General Category / General Discussion / Re: FORM tag inside on DataDrid toolbar on: September 12, 2012, 06:27:43 AM
Check that http://jsfiddle.net/seKvb/1/? and try to add style display:inline to form? also check  form margin, padding
12  General Category / General Discussion / Re: Replacement for linkbutton/menubutton/splitbutton on: September 12, 2012, 04:58:40 AM
Any response?
13  General Category / Bug Report / Re: DataGrid colspan bug on: September 12, 2012, 04:29:37 AM
But when  width of columns is set - it's work correcly?.
In documentation we can read following description "The width of column. If not defined, the width will auto expand to fit its contents."
14  General Category / Bug Report / DataGrid colspan bug on: September 12, 2012, 04:21:15 AM
DataGrid bug?
Please refer example http://jsfiddle.net/G57fE/, look at "percent"  field layout.
15  General Category / General Discussion / Re: Is it possible to post data to a datagrid without using JSON? on: August 18, 2012, 12:10:02 AM
You can convert html table to datajrid see http://jeasyui.com/tutorial/datagrid/datagrid1.php

If you need populate table using ajax (without json), by example using xml/html
You can do it manually
1. ajax request to  /some-page/
2. parser response
3. put parsed data to datagrid/local data array etc.
Pages: [1] 2
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!