EasyUI Forum
May 03, 2024, 06:57:23 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: 1 [2] 3 4
16  General Category / EasyUI for jQuery / datagrid 'sort' method without 'load' on: March 19, 2015, 06:59:07 AM
Hi,

I have been looking at the 'sort' method of the datagrid.
For performance, I re-use some datagrids in my application. I have to 'reset' them before re-use, and loading new data. To do this I first remove filters as I am using this extension. The method 'removeFilterRule' does this, and will not reload the data.
I also need to reset any user sort actions. My problem is that I have 'remoteFilter=true'. When I call the sort method, the datagrid is loaded after the new sort is applied.

What I really need is a 'resetSort' method, or a 'sortNoLoad' method. I understand I could copy the whole method and extend the object defaults, and then omit the 'load' part of the code, but am I missing an easier way to the same functionality?

Thanks
17  General Category / EasyUI for jQuery / Re: Combogrid + scrollview, ID is not translated to Value on: March 19, 2015, 06:54:49 AM
Hi,

No, unfortunately none of the solutions really worked for me.
My problem was using pagination on combogrid with large data resulted in the form value not being present in the grid data until that page was scrolled to.

I could not overcome this.

In the end, I changed all combogrids so that they displayed ID only, then made them hide their input field. I manually inserted another field next to the combogrid to act as the 'text' field for the data. I then programatically dealt with populating this as I required.

This was not an optimal solution, and I hope to revisit it soon.
18  General Category / EasyUI for jQuery / Re: Datagrid enableFilter performance problem on: March 18, 2015, 03:47:11 AM
Ha freaky I was just thinking about letting my users hide some of their columns to increase performance. i'm glad I didn't spend much time with that idea!

Is there anyone from the easyUI team who could comment about improving performance when using the datagrid-filters extension?
19  General Category / Bug Report / Form load, checkbox gets checked when value is 0 on: March 13, 2015, 02:22:28 AM
Hi,

I'm trying to chase down an issue that I had put a workaround in for, but now I'mwondering if it might be a bug?

Basically, I use $f.form('load',url) to fetch a record, which contains some checkboxes.
My source returns 0=unchecked, 1=checked for these fields.
When loaded, these checkboxes are checked when the value is zero.

It think it might be something in here:
Code:
       function _4c3(name, val) {
            var rr = $(_4c0).find("input[name=\"" + name + "\"][type=radio], input[name=\"" + name + "\"][type=checkbox]");
            rr._propAttr("checked", false);
            rr.each(function () {
                var f = $(this);
                if (f.val() == String(val) || $.inArray(f.val(), $.isArray(val) ? val : [val]) >= 0) {
                    f._propAttr("checked", true);
                }
            });
            return rr;
        };

So basically when the value is 0, then f.val() == String(val) evaluates as true.
Can you help?
20  General Category / Bug Report / Re: scrollTo method on datagrid with scrollview does not work on: March 13, 2015, 02:19:27 AM
Yet again you guys deliver! Thanks that has solved my problem!  Grin
21  General Category / Bug Report / scrollTo method on datagrid with scrollview does not work on: March 12, 2015, 10:15:44 AM
Hi

The build in method 'scrollTo' for datagrid (_645) uses opts.finder.getTr() to locate the position, so the scroll action can be made.
When the scrollview extension is used, and 'scrollTo' is called with an off-page index, then this method does nothing.

Is it possible to have a new method for scrollview that is capable of navigating to and off-page index? In my case I only want to move to the selected row, but I guess if possible it should work for any index.

Can anyone help?

Thanks
22  General Category / EasyUI for jQuery / Re: Datagrid enableFilter performance problem on: March 06, 2015, 03:57:03 AM
Thanks for this, I'm going to go and try some of this stuff now!

When I tried to analyse my 5-6 second initialisation on datagrid-filters, I see thousands of these browser reflow events:

"Forced synchronous layout is a possible performance bottleneck."
Usually, this is to do with 'getWidthOrHeight' and offsetHeight / width.

There certainly seems like some optimisation is needed on this extension.

See the attached for a snapshot of the type of event coming up in the broswer timeline analysis.
23  General Category / EasyUI for jQuery / Re: Update EasyUI Tab Without Refreshing on: March 03, 2015, 08:59:07 AM
Further to this thread, I have needed a method to update a tab panel body, but I was struggling to find a method to do this.
Can anyone comment if this looks ok?

Code:
    // Add a tab update method that will work from local variables.
    $.extend($.fn.tabs.methods, {
        updateNoAjax: function (jq, param) {
            return jq.each(function () {
                var t = $(param.tab);
                var opts = t.panel('options');
                opts.title = param.options.title;
                var tt = opts.tab.find('.tabs-title')
                tt.html(param.options.title);
                opts.content = param.options.content;
                t.html(param.options.content);
                $.parser.parse(t);
            })
        }
    })

Edit: Without $.parser.parse(t); the panel did not populate the easyui controls.
24  General Category / Bug Report / [REQUEST] edatagrid POST on New Record, PUT on Modified Record on: March 02, 2015, 06:12:35 AM
Hi,

I would like to request the facility in edatagrid plugin, to send Updated records as PUT ajax operation, and New records as POST. (Odata style - goes to same URL)

The current implementation sends both NEW and MODIFIED records as POST, but allows for different URLs.

Thanks
25  General Category / Bug Report / edatagrid with scrollview, addRow problems on: March 02, 2015, 04:41:16 AM
Hi,

I have an issue using an edatagrid extension, with scollview extension.

At first, using the function $('#eg').edatagrid('addRow'), the view jumps past the populated rows, leaving a large white space. The new row is added but becomes invisible. User must cancel to return to normal, but cannot insert their data.

I then tried $('#eg').edatagrid('addRow',0) to insert at the 'top' of the table, which works fine if the user has not scrolled/paged yet, but if they do then again the row is inserted outside of the viewable area, and user is stuck as before.

I'm looking for a workaround involving auto-scrolling to the top of the view before invoking addRow, but ideally the 'insert' row would be frozen somehow and would always appear at the top regardless of where the user had scrolled to.

This is easyui 1.4.1, with both extensions freshly downloaded.

Hope you can help!
26  General Category / Bug Report / [REQUEST] datagrid-filter extension, alternate iconCls for active filter column on: February 23, 2015, 03:17:39 AM
An Enhancement Request:

In the Datagrid Filter extension, would it be possible to have an 'active' iconCls option, so that columns with active filters are visually different from inactive (unfiltered) columns?
27  General Category / Bug Report / Datagrid: Can't scroll columns when there are no rows on: February 23, 2015, 03:14:06 AM
Hi,

This issue seems very similar in description to
this one.

I have a datagrid, with frozen columns, scrollview and filter row extensions.

The user makes a filter condition that returns zero rows. The horizontal scrollbar disappears, so they can no longer access filter controls to 'undo' their previous filter action.

The solution offered in the thread above seems to tinker with the 'view', where I already have scrollview plugin.
It seems based around having at least 1 row in the table, even if a fake one. Is it somehow possible to let overflow in the column headers also affect the scroll?

Thanks
28  General Category / EasyUI for jQuery / Re: Datagrid Filter - default Filter selection on: February 23, 2015, 03:04:10 AM
It didn't seem that anyone could help me with this unfortunately.
I was able to achieve it though, but not with an override or extend, I had to insert code into the source file which was less-than-elegant, but hey, sometimes the user just gotta get what the user wants!

So, at line 649 in datagrid-filter.js, I added the following:

Code:
//mod - set default filter on return keypress
$(input[0]).keypress(function (e) {
if (e.keyCode == 13) {
var input = $(e.target);
var field = input.attr('name');
var rule = $(target).datagrid('getFilterRule', field);
var value = input.val();
if (value != '') {
if ((rule && rule.value != value) || !rule) {
var setop = opts.defaultFilterOperator;
if (rule)
    setop = rule.op;
$(target)[name]('addFilterRule', {
    field: field,
    op: setop,
    value: value
});
$(target)[name]('doFilter');
}
} else {
if (rule) {
$(target)[name]('removeFilterRule', field);
$(target)[name]('doFilter');
}
}
    }
});
//end mod
29  General Category / General Discussion / Re: how to use keypress on numberbox on: January 30, 2015, 03:35:15 AM
You guys are superstars!  Wink

I ended up with this - quirk is that # is not an 'allowed char' in this field rather a shortcut for setting its value to a single hash. This is just the way these users work and I had to recreate the same workflow!

Code:
$yr.numberbox({
            icons: [
                {
                    iconCls: 'icon-hash',
                    handler: function (e) {
                        $(e.data.target).textbox('setValue', '#');
                    }
                }
            ],
            filter: function (e) {
                if (e.keyCode == 35) {  // #
                    $(e.data.target).textbox('setValue', '');
                    return true;
                } else {
                    return $.fn.numberbox.defaults.filter.call(this, e);
                }
            },
            parser: function (s) {
                if (s === "#") {
                    return s;
                } else {
                    return $.fn.numberbox.defaults.parser.call(this, s);
                }
            },
            formatter: function (v) {
                if (v === "#") {
                    return v;
                } else {
                    return $.fn.numberbox.defaults.formatter.call(this, v);
                }
            }
        });

Does that look like what you meant?
30  General Category / General Discussion / Re: how to use keypress on numberbox on: January 29, 2015, 05:19:22 AM
Hello, I'm struggling with this too!

On keypress I want a certain key '#' to be able to fill the field with a hash, even though it is a numberbox.
I have an icon that does the same thing, this works fine.
I can't however get the keypress event to set the hash. When the field loses focus the hash is removed from its value.

My code:
Code:
    var $yr = $('form#myform input.Year');
    if ($yr.length) {
        $yr.numberbox({
            icons: [
                {
                    iconCls: 'icon-hash',
                    handler: function (e) {
//this works fine
                        $(e.data.target).textbox('setValue', '#');
                    }
                }
            ],
            inputEvents: $.extend({}, $.fn.numberbox.defaults.inputEvents, {
                keypress: function (e) {
                    var result = $.fn.numberbox.defaults.inputEvents.keypress.call(this, e);
                    if (e.keyCode == 35) {
//this doesn't work
                        $(e.data.target).textbox('setValue', '#');
                    }
                    return result;
                }
            })
        });
    }

Can you help?
Pages: 1 [2] 3 4
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!