EasyUI Forum
April 29, 2024, 02:52:22 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 3 ... 6
1  General Category / General Discussion / Re: update row after edit, but the styler property does not change on: July 17, 2017, 08:14:02 AM
Well, I assume it's not possible

 Undecided
2  General Category / General Discussion / update row after edit, but the styler property does not change on: July 12, 2017, 08:50:15 AM
hi I have a datagrid with one cell editing:

Code:
<th data-options="field:'tag',width:80,align:'center',halign:'center',sortable:true,
                        styler: function (value,row,index){
                                return 'background-color:'+row.codigo+';';
                            },
                            formatter:function(value,row){
                            return row.tag;
                            },
                            editor:{
                                type:'combobox',
                                options:{
                                    valueField:'id_estatus',
                                    textField:'tag',
                                    method:'get',
                                    url:'retrieve/get_cmb.php',
                                    required:true,
                                    editable: false,
                                    onLoadSuccess:function(data){
                                        //alert(JSON.stringify(data));
                                    },
                                    onLoadError:function(data){
                                        //alert(JSON.stringify(data));
                                    }
                                }
                            }">TAG</th>

As you can see, the styler property gets the background color from a row.codigo, so after edit this row I want the background color changes as well.

I see the updateRow method, but I cant figure out how use it to change the styler property

$('#dg').datagrid('updateRow',{
   index: 2,
   row: { --------------------------------\
      name: 'new name',-------------> No need this
      note: 'new note message'-----/
   }--------------------------------------/
   styler: row.codigo, -----------------------------> how set the new background color?Huh??
});

Thank you
3  General Category / General Discussion / Re: Get The row data from index row on: June 24, 2017, 03:14:36 PM
Thank you jarry
 
It ok
4  General Category / General Discussion / Get The row data from index row on: June 23, 2017, 07:28:47 PM
Hello
I have The index of row, I need The row data
I has searched in forum and found The method getRow but I get error

How can get The row data from The row index?

Thanks
5  General Category / General Discussion / Re: texteditor copy/paste/cut on: June 23, 2017, 08:06:30 AM
hi stworthy

I has putting the validation like

Code:
name:'paste',
text:'Pegar',
iconCls:'icon-paste-large',
iconAlign:'top',
size:'large',
onClick:function(){
$('#editor').texteditor('getEditor').texteditor('execCommand','paste');
var result = document.queryCommandSupported('paste');
console.log(result);
}

the console wrote true but the image was not paste

The scenario was:

I has cutout an image with the windows tool "cutout" and I has clicked copy boton (cutout tool).
then I has clicked "paste" boton (texteditor easyui)
the image was not copied to the area editor (texteditor easyui) and console wrote: true  


6  General Category / General Discussion / Re: texteditor copy/paste/cut on: June 22, 2017, 11:59:03 AM
I even have buttons declared for this purpose

Code:
title:'Portapapeles',
tools:[{
name:'paste',
text:'Pegar',
iconCls:'icon-paste-large',
iconAlign:'top',
size:'large',
onClick:function(){
$('#editor').texteditor('getEditor').texteditor('execCommand','paste');
}
},{
type:'toolbar',
dir:'v',
tools:[{
name:'cut',
text:'Cut',
iconCls:'icon-cut',
onClick:function(){
$('#editor').texteditor('getEditor').texteditor('execCommand','cut');
}
},{
name:'copy',
text:'Copy',
iconCls:'icon-copy',
onClick:function(){
$('#editor').texteditor('getEditor').texteditor('execCommand','copy');
}
}]
}]


But it does not work either
7  General Category / General Discussion / Re: ribbon several botons on: June 22, 2017, 11:55:09 AM
Hello Jarry, thanks for your answer

I should tell that my ribbon is set like this:

Code:
$('#rr').ribbon({
data:data
});

And data variable content all declarations of botons

In this case how can I modified the js/css ribon class to get the horizontal scroll?

 Huh
8  General Category / General Discussion / ribbon several botons on: June 21, 2017, 11:14:01 AM
I have a ribbon but it has so many options that makes the ribbon create a second row

How can I adapt an horizontal scroll to avoid a second row?

thank you in advance
9  General Category / General Discussion / Re: texteditor copy/paste/cut on: June 20, 2017, 04:22:56 PM
I did but does not paste in the area editor

Sad
10  General Category / General Discussion / texteditor copy/paste/cut on: June 15, 2017, 04:48:35 PM
hi all

There's any way to enable paste images into the text editor. Same to the cut and copy functions.

I tried to paste a image print with ctrl+c and ctrl+v and nothing happend in the texteditor  Huh

Please some help, thanks
11  General Category / General Discussion / Re: datagrid pagination on: April 19, 2017, 06:16:03 AM
hi sworthy, yes Im secure that the returning properly data, this is my php script:

Code:
$page = isset($_POST['page']) ? intval($_POST['page']) : 1;
$rows = isset($_POST['rows']) ? intval($_POST['rows']) : 50;
$sort = isset($_POST['sort']) ? strval($_POST['sort']) : ''; 
$order = isset($_POST['order']) ? strval($_POST['order']) : '';
$offset = ($page-1)*$rows;

$q = isset($_REQUEST['q']) ? mysql_real_escape_string($_REQUEST['q']) : '';

$result = array();

$sql = "SELECT * FROM mytable WHERE field like '%$q%' ORDER BY $sort $order LIMIT $offset,$rows";

$rs = mysql_query($sql);

$items = array();
while($row = mysql_fetch_object($rs)){
array_push($items, $row);
}

$result["total"] = count($items);
$result["rows"] = $items;

echo json_encode($result);
But I think I know where is the problem now, I need do the same query with the count without LIMIT  Roll Eyes
12  General Category / General Discussion / datagrid pagination on: April 18, 2017, 01:24:48 PM
hello all

I have problems with pagination on datagrid

I put on my retrieve data script the variables $page and $rows like in the demo

Code:
$page = isset($_POST['page']) ? intval($_POST['page']) : 1;
$rows = isset($_POST['rows']) ? intval($_POST['rows']) : 50;

$offset = ($page-1)*$rows;

In the query is set limit like:

Code:
...
LIMIT $offset,$rows

The declaration of datagrid is:

Code:
<table id="dg" class="easyui-datagrid" style="width:100%;height:590px;" data-options="
                            singleSelect:true,
                            striped:true,
                            url:'../retrieve/get.php',
                            emptyMsg: 'No data',
                            toolbar:'#tb',
                            sortName:'fbit',
                            sortOrder:'desc',
                            multiSort:false,
                            pagination:true,
                            pagePosition:'bottom',
                            pageSize:50,
                            pageList:[50,100,150,200,250],
                            ..........

The problem is that the datagrid is showing only 50 rows and the pagination said Displaying 1 to 50 of 50 items

and is showing just one page, Page 1 of 1

There are 117 rows in my data base table

Maybe Im missing something?

Please your help, thanks
13  General Category / General Discussion / Re: append and loadFilter (tree) on: March 12, 2017, 01:50:19 PM
that is correct, thank you

I was trying with node.id instead node.target and was getting error

now is properly
14  General Category / General Discussion / append and loadFilter (tree) on: March 09, 2017, 06:57:50 PM
hello

Im using tree with loadFilter:

Code:
<ul id="t" class="easyui-tree" data-options="
                        url:'../retrieve/get.php',
                        method:'get',
                        animate:true,
                        lines:true,
                        loadFilter:treeFilter"></ul>

function treeFilter(rows,parent){
for(var i=0; i<rows.length; i++){
rows[i]['text'] = rows[i]['name'];
}
var nodes = [];
// get the top level nodes
for(var i=0; i<rows.length; i++){
var row = rows[i];
if (!row._parentId){
nodes.push(row);
rows.splice(i,1);
i--;
}
}
var toDo = [];
for(var i=0; i<nodes.length; i++){
toDo.push(nodes[i]);
}
while(toDo.length){
var node = toDo.shift(); // the parent node
// get the children nodes
for(var i=0; i<rows.length; i++){
var row = rows[i];
if (row._parentId == node.id){
if (node.children){
node.children.push(row);
} else {
node.children = [row];
}
toDo.push(row);
rows.splice(i,1);
i--;
}
}
}
return nodes;
}

the data shows properly, but when I try to append a child node, the node always apear in the same level of root:

Code:
var node = $('#t').tree('getSelected');
$('#t').tree('append', {
_parentId: node.id,
data: [{
id: 11,
name: 'new_name'
}]
});

I think " _parentId " is not been recognized and the node always take no parent as the root node

example:

-- root (id:1)
---- folder (id:2) <--------- append node "new"
------- file (id:3)

should be:

-- root (id:1)
---- folder (id:2)
------- file (id:3)
------- new (id:4)
 
instead I get:

-- root (id:1)
---- folder (id:2)
------- file (id:3)
-- new (id:4)

What Im trying to said is that "new" should by child of "folder" not on the same level of "root"

In the data base is saved properly and when I reload the tree "new" is in the right place

But I dont want/can reload the tree for this particulary case

some idea?

thanks
15  General Category / Bug Report / problem on datagrid when refresh version from 1.5 to 1.5.1 on: February 22, 2017, 02:24:43 PM
hi

-i have the filter function

Code:
$('#dg').datagrid('enableFilter');

but with the version 1.5.1

I get this error:

Quote
TypeError: $.fn.datagrid.methods[_7b6] is not a function

and the multisort fails, the server code get the order like:

Quote
order by field1, field2 desc, asc

thank you
Pages: [1] 2 3 ... 6
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!