Show Posts
|
Pages: 1 2 [3] 4 5 6
|
31
|
General Category / General Discussion / Re: treegrid get current id changes
|
on: February 01, 2017, 09:12:24 AM
|
hi stworthy I did what you said, but Im still get all rows not just what I have changed $('#tg-areas').treegrid({ onAfterEdit: function(row){ alert(JSON.stringify(row)); } });
I dont understand why this hapens other question how I determinated with onAfterEdit event if have changes or was canceled???
|
|
|
32
|
General Category / General Discussion / [SOLVED] treegrid get current id changes
|
on: January 31, 2017, 07:21:17 PM
|
hello, Im using treegrid edit mode like http://www.jeasyui.com/demo/main/?plugin=TreeGrid&theme=default&dir=ltr&pitem= (Editable TreeGrid) but in the save function of the demo, only showed how end editing row, and I have not been able to find the method to get the data just changed I readed the forum and saw a post where used find method, but this get all rows, not the current row I just changed this my code so far function save(){ if (editingId != undefined){ var t = $('#tg-areas'); t.treegrid('endEdit', editingId); //send data & save to db var row = t.treegrid('find',editingId); alert(JSON.stringify(row)); --> this print all rows data editingId = undefined; } }
some help please, thaks
|
|
|
34
|
General Category / General Discussion / Re: tooltip on datagrid + parameter = problem
|
on: November 02, 2016, 07:41:19 AM
|
hi stworthy I changed my code like you told me onLoadSuccess:function(){ $('.ttp').tooltip({ content: function(){return '<div></div>'}, position: 'right', hideEvent: 'none', onShow: function(){ var t = $(this); t.tooltip('tip').focus().unbind().bind('blur',function(){ t.tooltip('hide'); }); }, onUpdate:function(content){ var opts = $(this).tooltip('options'); var id_ticket = opts.param; content.panel({ width: 600, height: 'auto', border: false, href: 'resume_ticket.php?id_ticket='+id_ticket }); } }); }
but I get this error: Uncaught TypeError: content.panel is not a function if I do an alert of content: alert(JSON.stringify(content)); with content: function(){return '<div></div>'}, the alert is -- "<div></div>" --> get error with content: $('<div></div>'), the alert is {"0":{},"length":1} --> remains the problem
|
|
|
35
|
General Category / General Discussion / [SOLVED] tooltip on datagrid + parameter = problem
|
on: November 01, 2016, 12:22:20 PM
|
Hi all, I found my response in this post: http://www.jeasyui.com/forum/index.php?topic=1919.msg4247#msg4247and it works but I have an issue: 1. For each row in the table the tooltip with ajax content is created. 2. I position the mouse over the cell A, the ajax content is displayed in tooltip, no problem. 3. I position the mouse over the cell B and ajax content is displayed in tooltip, no problem. 4. I position the mouse over the cell A again, the tooltip is empty. 5. I position the mouse over the cell C, the ajax content is displayed in tooltip, no problem. 6. I position the mouse over the cell A and B again, the tooltip is empty. Here the code: declare tooltip in the datagrid: onLoadSuccess:function(){ $('.ttp').tooltip({ content: $('<div></div>'), position: 'right', hideEvent: 'none', onShow: function(){ var t = $(this); t.tooltip('tip').focus().unbind().bind('blur',function(){ t.tooltip('hide'); }); }, onUpdate:function(content){ var opts = $(this).tooltip('options'); var id_ticket = opts.param; content.panel({ width: 600, height: 'auto', border: false, href: 'resume_ticket.php?id_ticket='+id_ticket }); } }); }
then in every cell: formatter: function(value,row,index){ return '<a href=\'#\' class=\'ttp\' data-options=\'param:'+row.id_ticket+'\'>'+value+'</a>'; }
what I believe is that once the contents of a cell is requested, is not updated when the content is requested again appreciate any help thanks
|
|
|
37
|
General Category / General Discussion / Re: validate filebox
|
on: October 26, 2016, 04:51:49 PM
|
I change this: var file = $(this).next().find('.textbox-value'); for this: var file = $('#anexo').next().find('.textbox-value'); $.extend($.fn.validatebox.defaults.rules, { maxSize: { validator: function(value,param){ var file = $('#anexo').next().find('.textbox-value'); sizeKB = ((file[0].files[0].size)/1024).toFixed(0); if(sizeKB > 999){ return false; } }, message: 'The file must be 999 KB maximun.' } });
and its ok, it works but how can I do it dynamic?? second: I add a file of 425 KB and I get the maximun size error message if(sizeKB > 999){ alert(sizeKB); return false; } but 425 not is greater than 999 !!!
|
|
|
38
|
General Category / General Discussion / Re: validate filebox
|
on: October 26, 2016, 04:44:47 PM
|
Please now I want to extend the validate with the size maximun $.extend($.fn.validatebox.defaults.rules, { maxSize: { validator: function(){ var file = $(this).next().find('.textbox-value'); sizeKB = ((file[0].files[0].size)/1024).toFixed(0); if(sizeKB > 999){ return false; } }, message: 'The file must be 999 KB maximun.' } });
<input id="anexo" class="easyui-filebox" name="anexo" style="width:100%;height:32px;" data-options=" buttonText: 'Seleccione un archivo', label: 'Anexo:', labelPosition: 'left', labelWidth: 100, validType:'maxSize'" />
but I get this error: Uncaught TypeError: Cannot read property 'files' of undefined
What Im doing wrong?
|
|
|
40
|
General Category / General Discussion / [SOLVED] validate filebox
|
on: October 26, 2016, 04:17:17 PM
|
hello, Please help, I need validate the file size of a filebox <input id="anexo" class="easyui-filebox" name="anexo" style="width:100%;height:32px;" data-options=" buttonText: 'Seleccione un archivo', label: 'Anexo:', labelPosition: 'left', labelWidth: 100" />
This not work, because the input is not type file alert($('#anexo').files[0].size);
how can I get the filebox size? thanks
|
|
|
42
|
General Category / General Discussion / draggable by dynamic title
|
on: March 30, 2016, 01:47:39 PM
|
hello all I´m using for first time the draggable plugin and I need some help I have a loop with draggable boxes but I want it can only drag by the title , which is through by the handle property but as these boxes are created dynamically have no way to assign the property to every one, because the assignment of doing through a class all divs $(function(){ var indicator = $('<div class="indicator">>></div>').appendTo('body'); $('.drag-item').draggable({ revert:true, deltaX:0, deltaY:0, onDrag: function onDrag(e){ var d = e.data; if (d.left < 0){d.left = 0} if (d.top < 0){d.top = 0} if (d.left + $(d.target).outerWidth() > $(d.parent).width()){ d.left = $(d.parent).width() - $(d.target).outerWidth(); } if (d.top + $(d.target).outerHeight() > $(d.parent).height()){ d.top = $(d.parent).height() - $(d.target).outerHeight(); } } }).droppable({ onDragOver:function(e,source){ indicator.css({ display:'block', left:$(this).offset().left-10, top:$(this).offset().top+$(this).outerHeight()-5 }); }, onDragLeave:function(e,source){ indicator.hide(); }, onDrop:function(e,source){ //$(source).insertAfter(this); $(source).insertBefore(this); indicator.hide(); } }); });
I have relied on the example of the demos Now this is how I create the boxes inside the loop <div class="easyui-panel" style="position:relative;overflow:hidden;width:auto;height:350px;padding:5px 2px;"> <?php foreach($array as $item){ $name = explode("|",$item); $indice = $name[0]; $titulo = $name[1]; ?> <div id="<?php echo $indice; ?>" class="drag-item"> <div class="title-item"><?php echo $titulo; ?></div> </div> <?php } ?> </div>
How I can add the handle with a different title for each item? thanks
|
|
|
43
|
General Category / General Discussion / Re: scroll to a specific row , the first time to load the datagrid. using scrollview
|
on: May 27, 2015, 06:41:41 AM
|
hi sworthy I had already read this post, the funny thing is that when you put a fixed number works. but when I put the variable is not working. for the variable to the index where the scroll will be made , I have this code: click: function (e) { var area = this.name.substring(2,4); var ind = 0; var ban = 0; $('#dgA').datagrid('getPanel').panel('expand',true); $('#dgA').datagrid({ collapsed:false, rowStyler: function(index,row){ if(row.clave===undefined){ //alert('a'); } else{ var clv = row.clave; //alert(clv); var clave = clv.substring(2); //alert(clave); if (clave==area){ if(ban==0){ ind = index; //alert(ind); ind = ind+1; //alert(ind); ban = 1; } return 'background-color:#ffee00;font-weight:bold;'; } } } }); alert(ind); $('#dgA').datagrid('scrollTo',40); //------------> when I put fixed number works $('#dgA').datagrid('scrollTo',ind); //------------> when I put the variable does not work }
what I'm trying to do. is that when they give click a point on a chart . highlight the datagrid rows that are related to that point. and at the same time, then scroll to the first row that matches the point so, Also try to do in the onloadsucces method but only works for the first time , as again after reload the datagrid, scroll back to the given row What I can do? thanks
|
|
|
44
|
General Category / General Discussion / scroll to a specific row , the first time to load the datagrid. using scrollview
|
on: May 26, 2015, 09:00:24 AM
|
Hi , I'm using the scrollview extension if I want to scroll to a row that is not in the first 50 rows, the scrollTo does not work. here my datagrid properties: pagination:false, rownumbers:true, nowrap:false, fitColumns:false, singleSelect:true, striped:true, showFooter:true, remoteSort:false, view:scrollview, autoRowHeight:false, pageSize:50
the only way that worked was putting the method when loading the datagrid. when I load the datagrid need to make a scrollTo to the row that already have a variable: onLoadSuccess: function(data){ $('#dgA').datagrid('scrollTo',ind); }
the method scrollTo put it in the onloadSucces event, the first time works fine, but when I navigate in the scroll , the datagrid is reloaded then the scroll back to row, I can not continue to browse the rows of the datagrid Where should I put the method or the way the ScrollView can load all the data and is not limited by pageSize??? thanks
|
|
|
|