EasyUI Forum
May 17, 2024, 05:28:55 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
1  General Category / EasyUI for jQuery / Validate combobox validation with inline datagrid on: May 04, 2018, 07:41:02 AM
Need to validate a combobox selection - (in this case there is a limit on rows with the same selection)

onChange event is capturing new and old values.

I just need to reset the combobox value but not sure how to do that. Thanks for any help:


    $('#userGrid').datagrid({
        fit: true,
        idField:'key',
        singleSelect: true,
        columns:[[
           {field:'licenseType', title:'License', fixed: true, width: 120, sortable:'true',remoteSort:false,multiSort:true,
                formatter:function(value,row){
                    return row.licenseType;
                },
                editor:{
                    type:'combobox',
                    options:{
                        limitToList: true,
                        panelHeight: 60,
                        valueField:'licenseType',
                        textField:'label',
                        method:'get',
                        mode:'local',
                        data: [{
                              label: 'Administrator',
                              licenseType: 'Administrator'
                            },{
                              label: 'Analyst',
                              licenseType: 'Analyst'
                            },{
                              label: 'Author',
                              licenseType: 'Author'
                            }],
                        required:true,
                        onChange:  function(newValue,oldValue){
                          alert(newValue);
         
                          \\ update value here          
          }
2  General Category / EasyUI for jQuery / Is it possible to change editor for column when row is in edit mode on: April 09, 2018, 07:07:44 AM
I would like to change the editor of a datagrid column when another column in the row changes using a combobox.

This line runs:   col.editor = checkBoxEditor 

and it changes the editor of the object (see attached) but does not update the datagrid.


            {field:'licenseType', title:'License', fixed: true, width: 120,
                formatter:function(value,row){
                    return row.licenseType;
                },
                editor:{
                    type:'combobox',
                    options:{
                        limitToList: true,
                        valueField:'licenseType',
                        textField:'label',
                        method:'get',
                        mode:'local',
                        data: [{
                              label: 'Administrator',
                              licenseType: 'Administrator'
                            },{
                              label: 'Analyst',
                              licenseType: 'Analyst'
                            },{
                              label: 'Author',
                              licenseType: 'Author'
                            },{
                              label: 'Consumer',
                              licenseType: 'Consumer'
                            }],
                        required:true,
                        onChange:function(newValue, oldValue) {
                            if (oldValue != '') {
                                var col = $('#userGrid').datagrid('getColumnOption', 'modelItem');
                                if (newValue == 'Analyst') {
                                    col.editor = checkBoxEditor;
                                } else {
                                    col.editor = null;
                                }
                            }
                        }
                    }
                }
            },


Thanks for any assistance.

3  General Category / EasyUI for jQuery / Re: Delay in Window display on: October 07, 2014, 09:56:35 AM
Looks like it's hanging in my Java code before the window displays.

Sorry for bothering you with this one,
Gary
4  General Category / EasyUI for jQuery / Re: Delay in Window display on: October 06, 2014, 07:40:22 AM
Thanks for the example, but things are behaving differently when creating objects with code.

In this example the datagrid is created in the window onOpen() event.  When test2.html is opened, nothing will be displayed until the datagrid is populated:

https://netvisn.sharefile.com/d/s0f77ac3d0f5456a9

I need to inform users that data is being loaded.

Thanks for your help,
Gary
5  General Category / EasyUI for jQuery / Re: Delay in Window display on: October 04, 2014, 10:50:40 AM
Hi,

Thanks for your help.  Trying out a lot of options but still have no success.

All of the code and html to create the datagrid is now in the window onOpen event.  Even with this the window will not display until the datagrid has loaded.  Is that the last event to be fired on a window being displayed?

This project is real close to being released to customers so I will be needing an EasyUI license soon.  Is there another means by which I can tell a user that the window is being prepared for display?

Background: The app has ability to display multiple datagrids.  Putting the datagrids in windows makes them dragable.  Maybe a solution would be to make the datagrid dragable, except that the windows styling seems nicer.

Thanks,
Gary

6  General Category / EasyUI for jQuery / Re: Delay in Window display on: October 03, 2014, 01:46:10 PM
Had another attempt at this. I'm guessing it's due to the datagrid being inside a window but not sure.

Moved the datagrid code to the onOpen event of the window thinking that the window would be visible before the datagrid started loading.

No luck.  The window was not shown until the data loaded.  Anyway around this?

Thanks,
Gary
7  General Category / EasyUI for jQuery / Re: Delay in Window display on: October 03, 2014, 10:06:25 AM
Problem is I can't get the data in pages from the source.  That's what's taking the time.  Once the data is there the grid loads fast.

I'm thinking of setting up the loader initially with a url with no data, and with the Panel onOpen event, change the url to the real one.

Am I on the right track?

Thanks,
Gary
8  General Category / EasyUI for jQuery / Re: Delay in Window display on: October 03, 2014, 08:32:34 AM
I may not be using pagination correctly.  Need to check that out.

Thanks
9  General Category / EasyUI for jQuery / Delay in Window display on: October 03, 2014, 06:09:25 AM
Hi,

A Window is being created in code (a result of a drop).  The Window contains a DataGrid which is populated with a loader().

When the loader takes a long time to load due to many rows, the Window will not be displayed until the loader is finished.  Ideally the Window and DataGrid would be displayed while the loader is running so the user can see 'Processing....' message.

Would you have any ideas solve this?

Thanks,
Gary
10  General Category / EasyUI for jQuery / The proper way to destroy objects on: August 25, 2014, 01:53:46 PM
The app has multiple windows each of which contain a datagrid.  What's the best way to get rid of a window/datagrid?  They will not be needed anymore so I would like to clean up as much as possible.

Thanks,
Gary
11  General Category / EasyUI for jQuery / Re: DataGrid loader fires multiple times on: August 25, 2014, 09:47:35 AM
Bingo!  Thanks for you help.
12  General Category / EasyUI for jQuery / Re: DataGrid loader fires multiple times on: August 22, 2014, 10:29:47 AM
Thanks for the explanation.  Making progress but can't figure out why toolbar icons are not showing:

<div id="toolbarxOkJJIE1hcmtldGluZyBFdmVyeW9uZQ__" class="datagrid-toolbar">
<a onclick="javascript:groupSort(&quot;xOkJJIE1hcmtldGluZyBFdmVyeW9uZQ__&quot;)" plain="true" iconcls="icon-save" class="easyui-linkbutton" href="#">Default</a>
</div>

Pasted the <a> in an EasyUI demo and it worked.   The toolbar icon worked using iconCls: 'icon-sort' property.

Thanks for any suggestions,
Gary
13  General Category / EasyUI for jQuery / DataGrid loader fires multiple times on: August 21, 2014, 01:34:15 PM
I've seen other topics like this which helped me narrow down the problem.

I have a need to dynamically change the DataGrid title and toolbar. This code will fire the loader:

  dg.datagrid({
    title: title,
    toolbar: toolbar
  });

When pagination is defined it also fires the loader:

        var pager = dg.datagrid('getPager');
        pager.pagination({
          displayMsg: '{from} to {to} of {total} items',
          layout:['list','first','prev','next','last']
        });

Is there a way to avoid this, am I doing something wrong?  The loader is defined like this:

          loader:function(param,success,error){
            $.ajax({
              type: 'POST',
              url: 'init-group-members?n_tab_id=' + $.urlParam('n_tab_id') + '&groupId=' + g.id,
              data: param,
              dataType: 'json',
              async: false,
              success: function(data){
                success(data);
              },
              error: function(){
                error.apply(this, arguments);
              },
              complete: function(jqXHR, textStatus) {
              }
            });
          }

14  General Category / EasyUI for jQuery / Re: Textbox has cancel icon (x) in IE 11 on: August 21, 2014, 12:42:16 PM
Thank you!
15  General Category / EasyUI for jQuery / Textbox has cancel icon (x) in IE 11 on: August 19, 2014, 08:22:53 AM
Hi,

A textbox in IE 11 shows an 'x' after entering characters.  This does not happen in Firefox.

I want to use the clear icon textbox demo example but in IE both are displayed.

Thanks for any help,
Gary
Pages: [1] 2 3
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!