Show Posts
|
Pages: [1] 2 3 ... 6
|
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: <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? ?? }); Thank you
|
|
|
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 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 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: $('#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?
|
|
|
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 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: $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
|
|
|
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 $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: The declaration of datagrid is: <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 itemsand is showing just one page, Page 1 of 1There are 117 rows in my data base table Maybe Im missing something? Please your help, thanks
|
|
|
14
|
General Category / General Discussion / append and loadFilter (tree)
|
on: March 09, 2017, 06:57:50 PM
|
hello Im using tree with loadFilter: <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: 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
|
|
|
|