EasyUI Forum
May 14, 2024, 11:06:45 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 / Bug Report / Re: datagrid.getSelections is not returning selected rows on: May 30, 2012, 03:43:44 AM
Actually i solved the problem. It was because the idField of the table i was using was incorrect.

it appears that the getSelections uses the idField property so you need to make sure that the idField is actually the same as the one passed in the json data.
2  General Category / Bug Report / datagrid.getSelections is not returning selected rows on: May 28, 2012, 07:12:52 AM
Hi,

I have a table that i am creating with code, ie:

Code:
$('#users').datagrid({
title : 'Users',
iconCls : 'icon-user',
width : '100%',
height : 'auto',
nowrap : true,
striped : true,
collapsible : false,
url : "/getUsers",
sortName : 'userId',
loadMsg: 'Loading data form server..',
sortOrder : 'desc',
remoteSort : true,
idField : 'userId',
doSize:true,
fit:true,
columns : [ [ {
title : 'User ID',
field : 'userId',
width : 60,
sortable : true
}, {
field : 'username',
title : 'Username',
width : 90,
rowspan:2,
sortable : true,
sorter : function(a, b) {
return (a > b ? 1 : -1);
}
} , {
field : 'name',
title : 'Name',
width : 350,
rowspan:2,
sortable : true,
sorter : function(a, b) {
return (a > b ? 1 : -1);
}
} ] ],
pagination : true,
rownumbers : true
});

I then have a button that when you click on it calles this function:

Code:
function getSelections(){
var ids = [];
var rows = $('#users').datagrid('getSelections');
for(var i=0;i<rows.length;i++){
ids.push(rows[i].id);
alert(ids[i]);
}
}

However no matter how many rows i select, the rows variable only shows me 1 selection (the last one i choose).

Here is the html of my table:

Code:
<table id="users" maximizable="false" toolbar="#userSearchtb"></table>
3  General Category / Bug Report / collapsing panel when moving on: May 16, 2012, 12:12:47 AM
I would like to know if its possible to collapse a panel when the user begins to move it.

In this post (http://www.jeasyui.com/forum/index.php?topic=270.0) there is an example of hiding the panel contents when the user is dragging. I have tried modifying the example code pasted in this thread but i cant seem to make the panel collapse. Could someone suggest a way please?

All i would like to see is that when the user starts to drag the panel it should collapse. Doing this means the user can move the panels much more quickly and fluid since big panels with data can make the dragging movement very slow and in some cases not functional at all.

Thanks
4  General Category / EasyUI for jQuery / collapsing panel when moving on: May 14, 2012, 11:29:50 AM
I would like to know if its possible to collapse a panel when the user begins to move it.

In this post (http://www.jeasyui.com/forum/index.php?topic=270.0) there is an example of hiding the panel contents when the user is dragging. I have tried modifying the example code pasted in this thread but i cant seem to make the panel collapse. Could someone suggest a way please?

All i would like to see is that when the user starts to drag the panel it should collapse. Doing this means the user can move the panels much more quickly and fluid since big panels with data can make the dragging movement very slow and in some cases not functional at all.

Thanks
5  General Category / Bug Report / Re: Panel onMove event does not fire. on: May 14, 2012, 08:47:32 AM
I would still like to know if its possible to collapse the panel when the user begins to move it. I have tried modifying the example code pasted in this thread but i cant seem to make the panel collapse. Could someone suggest a way please?

Thanks
6  General Category / EasyUI for jQuery / Re: draggable datagrid columns on: February 27, 2012, 02:02:06 AM
thanks stworthy, it worked brilliantly. I missed out the bottom two lines when i tried to use it so thats why it did not work.

Thank you very much!
7  General Category / EasyUI for jQuery / Re: draggable datagrid columns on: February 24, 2012, 01:27:07 AM
Hi,

thanks for this. I have pasted your code into my page that has a table (with columns that can be removed/shown by right click menu), however it seems like your code does not actually do anything.
When i try to drag a column, nothing happens, my mouse pointer does not even change to suggest that i can drag the columns.

Where exactly should I be placing the main part of your code?
Would it be possible to see a working demo of your code?

Thanks, I really appreciate this.
8  General Category / EasyUI for jQuery / draggable datagrid columns on: February 17, 2012, 06:42:25 AM
Hi,

is it possible to drag datagrid columns to change their order? I have not found any examples on the site and the documentation does not mention anything but it surprises me that this is not possible.
9  General Category / EasyUI for jQuery / Re: create dialog from script on: February 08, 2012, 06:56:06 AM
ok problem solved. This is what i ended up doing:

Quote
$(function(){
      $('#dd').dialog({
         closed:true,
         title:'Unsaved Changes',
         buttons:[{
            text:'Yes',
            iconCls:'icon-ok',
            handler:function(){
               //do something
            }
         },{
            text:'No',
            handler:function(){
               //do not save but go to link requested
               $('#dd').dialog('close');
            }
         },{
            text:'Cancel',
            handler:function(){
               //do nothing
               $('#dd').dialog('close');
            }
         }]
      });
   });

I still needed to have a predefined div, but i just set it to closed in the code above.
10  General Category / EasyUI for jQuery / create dialog from script on: February 08, 2012, 05:24:40 AM
Hi,

im trying to create a dialog with two buttons (yes, no) from script. The examples on the site already have a the pop visible with divs. Basically when a user clicks on a link on my site i want the dialog to appear.

So far I can do that by using this:

Quote
$.messager.confirm('Unsaved Changes', 'Save before proceeding?', function(r){
            if (r){
               //user said yes
               alert('confirmed:'+r);
            } else {   
               //user said no, so do not save and redirect
               parent.location.href = requestedLink;
            }

However what I would like to know is how do i tell it to show a 'yes' button and a 'no' button? Obviously the dialog should only be shown when the user clicks on a link on my site.. The documentation does not seem to show this, neither does the demo.

Thanks
11  General Category / EasyUI for jQuery / Re: how to add maximise icon and functionality to a panel (portal) on: January 30, 2012, 02:55:28 AM
Hey tslatt, I just tried the solution that was posted in the other thread for moving the panels and it works perfectly!

Literally i just pasted the solution that was suggested in the thread without changing anything and it works right out of the box so to speak Smiley

Basically now when i move a panel the contents gets hidden (just like on google dashboard) so it means that you are not moving heavy contents around. And now the problems i had is gone.

See my two screenshots where you can see the panel being moved and then placed.
12  General Category / EasyUI for jQuery / Re: how to add maximise icon and functionality to a panel (portal) on: January 19, 2012, 08:23:25 AM
yeah my thoughts exactly, because i also tried putting an alert but it did nothing... Its the only way i can think of for collapsing the panel when someone starts moving them..
13  General Category / EasyUI for jQuery / Re: how to add maximise icon and functionality to a panel (portal) on: January 19, 2012, 07:54:23 AM
Hi tslatt,

thanks for the quick response, its good to know that there are active people on this forum Cheesy

I literally just finished implementing the same solution as you suggested just before you replied! Its the only way i could get it to work because im adding the panels dynamically. Weird how the panels stop moving though if i do it the other way considering i have all of the latest code and css..well i think i do anyways!

Do you remember i posted a while back that when i move the panels the mouse loses focus? Well i have established that this only happens if i move the panels whilst they are opened (as in not collapsed) and only if they have big data in them, such as a datagrid or graph etc.

If the panels are collapsed i dont have this problem at all..im guessing its something to do with the contents. Do you think there is something i can do so that when i start moving a panel it automatically collapses? that way the panel being moved would always be collapsed and i would avoid the mouse pointer issue. I tried doing something with the onMove function (i.e. onMove = function() {     panel.collapsed = true };) but didn't seem to do anything..
14  General Category / EasyUI for jQuery / Re: how to add maximise icon and functionality to a panel (portal) on: January 19, 2012, 05:07:04 AM
Actually, i have also noticed, that if i do that, the panel is no longer movable!? when i add an icon like that i can no longer drag the panel..

Basically all i want to do is add a refresh button to my panels so that it's contents can be refreshed.

Any ideas?
15  General Category / EasyUI for jQuery / Re: how to add maximise icon and functionality to a panel (portal) on: January 19, 2012, 04:57:29 AM
I have tried doing this:

Quote
$(function(){
         $('#pp').portal({
            border:false,
            fit:true
         });
         add();
         
         var panels = $("#pp").portal('getPanels');
            for(var i=0; i<panels.length; i++){
                panels.panel('options').onClose = function(){
                    removeWidget($(this)); //closed widget
                };
                panels.panel('options').onMaximize = function() {
                   expandWidget($(this));
                };
                panels.panel({tools: [{ 
                      iconCls:'icon-reload', 
                      handler:function(){
                         widgetRefresh($(this));
                         } 
                    }]});
            }
      });

Which works in the sense that it adds the icon and method to all the panels (i call them widgets) on my page, however $(this) is not the panel object, for some reason its referring to the 'icon-reload' class, where as on the other two functions above (onClose and onMaximise) it is referring to the panel object.

Any ideas?
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!