EasyUI Forum
April 29, 2024, 06:59:04 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 4 5
16  General Category / EasyUI for jQuery / Re: fitColumns:true with rowNumber and/or detailview shows horizontal scrollbar on: June 11, 2016, 11:55:32 PM
Aside note:
When using absolute values instead of percentages in 'width' field options, method fitColumns works as expected: no horizontal scrollbar and fields expanded to fit available width

From your sample tests. Just set rownumbers to true/false to see horizontal scrollbar behaviour
Code:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Basic DataGrid - jQuery EasyUI Demo</title>
<link rel="stylesheet" type="text/css" href="../lib/jquery-easyui-1.4.2/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../lib/jquery-easyui-1.4.2/themes/icon.css">
<link rel="stylesheet" type="text/css" href="../lib/jquery-easyui-1.4.2/demo/demo.css">
<script type="text/javascript" src="../lib/jquery-1.12.3.min.js"></script>
<script type="text/javascript" src="../lib/jquery-easyui-1.4.2/jquery.easyui.min.js"></script>
</head>
<body>

<div id="myWindow" class="easyui-window" style="width: 600px; height: 200px" data-options="resizable:true">

<table id="dg" class="easyui-datagrid"
data-options="singleSelect:false,
url:'../lib/jquery-easyui-1.4.2/demo/layout/datagrid_data1.json',
method:'get',
fit:true,
fitColumns:true,
rownumbers:true">
<thead>
<tr>
<th data-options="field:'itemid',width:'10%'">Item ID</th>
<th data-options="field:'productid',width:'15%'">Product</th>
<th data-options="field:'listprice',width:'10%',align:'right'">List Price</th>
<th data-options="field:'unitcost',width:'15%',align:'right'">Unit Cost</th>
<th data-options="field:'attr1',width:'30%'">Attribute</th>
<th data-options="field:'status',width:'20%',align:'center'">Status</th>
</tr>
</thead>
</table>

</div>

</body>
</html>
17  General Category / EasyUI for jQuery / fitColumns:true with rowNumber and/or detailview shows horizontal scrollbar on: June 11, 2016, 01:14:23 AM
Hi all!

Manual says that method fitCoulumns shoult be used to prevent horizontal scrolling... but when I set rownumbers to 'true', or set view to 'detailview', these extra columns are not included as part of datagrid and as result, horizontal scrollbar appears

What can I do to disable completely either horizontal or vertical scrollbars in datagrid ¿Perhaps setting scrollbarsize to zero?

(using easyui 1.4.2)

Thanks in advance
Juan Antonio
18  General Category / EasyUI for jQuery / Re: set parent datagrid row height, but let unchanged row height on subgrid on: May 27, 2016, 02:29:57 AM
Fine, but this affect every datagrid in page (including combos, and so...). And the inner datagrid-cell height is not affected, just the entire row. I want to reserve enought space to add some icons in parent row, so need increase also datgrid-cell height

My final solution was:
Code:
        <div id="pb_tabla" data-options="region:'center'">
                <table id="pb_finales-datagrid"></table>
        </div>

Code:
    
<style>
    #pb_tabla .datagrid-row {
        height:40px;
        line-height: 40px;
    }
    #pb_tabla .datagrid-row .datagrid-cell {
        height:35px;
    }
    #pb_tabla .datagrid-row-detail .datagrid-row {
        height:25px;
        line-height: 25px;
    }
</style>

Code:
<script type="text/javascript">
....
$('#pb_finales-datagrid').datagrid({....});
</script>

Thanks for your help. Cheers
19  General Category / EasyUI for jQuery / set parent datagrid row height, but let unchanged row height on subgrid on: May 26, 2016, 09:48:49 AM
I have a detailview datagrid with subgrids, and want to change parent row height (to emphasize these rows) , but let unchanged subgrids row height

What's the right way to to?

(Using easyui-1.4.2)

Thanks in advance
Juan Antonio
20  General Category / EasyUI for jQuery / Re: Add title in colapsed layout in version 1.4.2 on: March 14, 2016, 04:09:32 AM
Sorry: Ignore this question: already asked and solved. Thanks
21  General Category / EasyUI for jQuery / Add title in colapsed layout in version 1.4.2 on: March 14, 2016, 03:59:47 AM
( yes, I know: I should update, but need time to test my patches... )

Is there an easy way to set title to a collapsed layout region in 1.4.2 version as 1.4.4 does ?

Thanks in advance
Juan Antonio
22  General Category / EasyUI for jQuery / Re: window('open'); something.each(); then window('close') doesn't work in chrome on: August 23, 2015, 01:27:17 AM
OK. I've seen deprecation notice in chrome dev console, but didn't know that modern chrome just ignores 'async:false' directive

I'll rewrite my code.
Thanks
23  General Category / EasyUI for jQuery / window('open'); something.each(); then window('close') doesn't work in chrome on: August 22, 2015, 04:30:01 PM
Hi all.
I want a progress dialog window to be shown while several ajax call are being processed. So I have following code:
Code:
<!-- progress window to show inscription progress -->
<div id="new_inscripcion-progresswindow" class="easyui-window"
data-options="title:'Processing...',width:450,modal:true,collapsable:false,minimizable:false,maximizable:false,closable:false,closed:true">
<p id="new_inscripcion-progresslabel" style="text-align:center">Inscribiendo a:</p>
<div id="new_inscripcion-progressbar" class="easyui-progressbar" style="width:300px;text-align:center;" data-options="value:0"></div>
</div>
....
function insertInscriptions(dg) {
....
        var pwindow=$('#new_inscripcion-progresswindow');
var selectedRows= dg.datagrid('getSelections'); // take selected rows from provided datagrid
var count=1;
var size=selectedRows.length;

pwindow.window('open');
$.each(selectedRows, function(index,row) {
$('#new_inscripcion-progresslabel').text("Inscribiendo a: "+row.Nombre);
$('#new_inscripcion-progressbar').progressbar('setValue',(count*(100/size)).toFixed(2));
$.ajax({
           async: false, // NOTICE async set to false to ensure each() returns after last ajax call completed
           cache: false,
           timeout: 10000, // 10 seconds
   type:'GET',
   url:"/agility/server/database/inscripcionFunctions.php",
   dataType:'json',
   data: {
                               .....
   }
});
count++;
});
pwindow.window('close');
....
}

This code works fine in firefox: window is displayed, and progressbar shows progress on each ajax sync call; and when last ajax call is performed, window is closed
But when running in Google Chrome, window does not appear, ajax calls are performed but no window nor progress shown

What am I doing wrong?
Thanks in advance
24  General Category / EasyUI for jQuery / $.messager.progress not updated in windows on: August 15, 2015, 04:06:25 AM
Hi all
I'm using a $.messager.progress to monitorize a php long-script task at server side.
This is done by mean of making calls to server and retrieve progres status stored in $_SESSION variables

Here comes the relevant client side code:

Code:
                   // open messager window
                   $.messager.progress({
                        title: 'Restore',
                        msg: 'Restoring database',
                        interval: 0 // do not perform auto update.
                    });

                    // perform call to long time consuming php server side task ( restore database contents with provided file )
                    $.ajax({
                        type:'POST', // use post to send file
                        url:"/agility/server/adminFunctions.php",
                        dataType:'json',
                        data: {
                            Operation: 'restore',
                            Data: $('#tools-restoreData').val()
                        },
                        contentType: 'application/x-www-form-urlencoded;charset=UTF-8',
                        success: function(data) {
                            if (data.errorMsg){
                                $.messager.show({ width:300, height:150, title: 'Database Restore Error', msg: data.errorMsg });
                            } else {
                                $.messager.alert("Restore Database","Base restore success<br />Please reinit application","info");
                            }
                            $.messager.progress('close');
                        },
                        error: function(XMLHttpRequest,textStatus,errorThrown) {
                            $.messager.alert("DBRestore Error","Error: "+textStatus + " "+ errorThrown,'error' );
                            $.messager.progress('close');
                        }
                    });

                    // function to monitorize database restore progress info
                    function getProgress(){
                        $.ajax({
                            url:"/agility/server/adminFunctions.php",
                            dataType:'json',
                            data: {
                                Operation: 'progress'
                            },
                            success: function(data) {
                                if( data.progress !== "Done" ){
                                    var bar = $.messager.progress('bar');  // get the progressbar object
                                    bar.progressbar('setValue', data.progress);  // set new progress value
                                    setTimeout(getProgress,200); // reload progress status in 200 msecs
                                } else {
                                    $.messager.progress('close');
                                }
                            }
                        });
                    }

                    // start monitoring database restore progress info
                    setTimeout(getProgress,200);

At server side there are "standard" session status handling:
Code:
.....
if ($operation==="progress") {
// retrieve session status and return
session_start();
$sid="0";
if (isset($_SESSION["progress"])) $sid=$_SESSION["progress"];
echo json_encode( array( 'progress' => strval($sid) ) );
return;
}
....

// called several times from long time consuming php process
function setSessionProgressStatus($str) {
session_start(); // if session is already started this call is ignored
$_SESSION["progress"]=$str;
session_write_close(); // flush and unlock session vars to allow another process to access them
}
....


I't works fine.... in Linux and Mac.
When trying  to use it in Windows 7 (either Fireforx or Chrome) only one ajax call is submitted to monitorize progress, Thus only last "Done" report is received

I'm unsure but think that long script blocks server, so progress monitor calls are ignored until main task ends, thus the one and only message received is last one

Is it true, or there are something wrong in my client-side code?

Thanks in advance
Juan Antonio
25  General Category / EasyUI for jQuery / Re: Right way to programmatically retrieve next/prev Row data in scrollview? on: July 17, 2015, 02:45:17 AM
!! Great !!

Now everything works as expected.

About detecting end-of-rows: I Finally added an extra field "totalRows" to datagrid and populated with 'total' field from json response to check against end of recors to prevent nextRow() to go beyond the available data

Thanks for your time and work
Juan Antonio
26  General Category / EasyUI for jQuery / Re: Right way to programmatically retrieve next/prev Row data in scrollview? on: July 16, 2015, 05:18:44 AM
Sorry again: I've found some conditions where your code fails:

1- When datagrid is not visible (i.e. in a collapsed layout), seems as scrollTo() or selectRow() has no effect, and new rows are not properly loaded.
If I made layout panel where datagrid resides visible, everything works fine

Here comes a firebug trace capture. Assumed pageSize=20:





2- How can I detect that we are already in _last_ row of last page, to avoid invoke of nextRow()?

Thanks in advance
Juan Antonio
27  General Category / EasyUI for jQuery / Re: Right way to programmatically retrieve next/prev Row data in scrollview? on: July 14, 2015, 11:23:20 PM
Thanks: I was looking for a way to trigger onSelect just once. your code did the trick

Juan Antonio
28  General Category / EasyUI for jQuery / Re: Right way to programmatically retrieve next/prev Row data in scrollview? on: July 14, 2015, 02:29:34 AM
Thanks, but adding idField only resolves part of the problem: select next row in scrollview

http://www.jeasyui.com/forum/index.php?topic=483.0

But my problem is to retrieve data from next row. This code still returns null on page change

Code:
function nextRow(){
var dg = $('#dg');
var row = dg.datagrid('getSelected');
var index = dg.datagrid('getRowIndex', row);
dg.datagrid('scrollTo', index+1);
dg.datagrid('selectRow', index+1);
        return dg.datagrid('getSelected');
}

FYI: firebug returns this error:
Code:
(2) TypeError: a[i] is undefined                                 jquery.....min.js (línea 9086)
if(a[i][opts.idField]==r[opts.idField]){
Seems that js is trying to read row data _before_ data is effectively loaded

29  General Category / EasyUI for jQuery / [SOLVED]Right way to programmatically retrieve next/prev Row data in scrollview? on: July 14, 2015, 12:41:06 AM
Hi all.
I have an scrollview with hundreds of entries, and want to navigate throught rows by a sort of cursor
So i wrote something like:

Code:
var currentRow;
....
function nextRow() {
    dg.datagrid('scrollTo',currentRow+1);
    dg.datagrid('selectRow', currentRow+1);
    var data =dg.datagrid('getSelected');
    if (data) currentRow++;
    return data;
}

This works fine in 'normal' datagrids, but fails with scrollview when next row implies a server call to retrieve next data (returns null instead of next row data)

What's the right way to retrieve next/prev row data in scrollview?

Thanks in advance
Juan Antonio
30  General Category / Bug Report / Re: Infinite loop using scrollview in subgrid when empty data is returned on: July 13, 2015, 02:13:40 AM
OK. Now everything works fine. Thanks

Juan Antonio
Pages: 1 [2] 3 4 5
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!