jQuery EasyUI Forum
May 27, 2017, 12:58:27 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1] 2 3 ... 10
 1 
 on: May 26, 2017, 08:11:59 PM 
Started by ljpxg - Last post by jarry
Please update the EasyUI to a newer version, or try to include this code to your page.
Code:
<style>
  .textbox textbox-text{
    white-space: pre-wrap;
  }
</style>

 2 
 on: May 26, 2017, 01:42:55 AM 
Started by ljpxg - Last post by ljpxg
try to input some character in textbox , and post to php server, the php receive data was wrong, not the string which we input in the textbox.

example, in multiline textbox , we input three character: char '1' and space character, then enter into new line, input char '2' at second line, and finished to post.

the string which we input into textbox is '1 \n2', then get the textbox value by $("#test").textbox("getValue") , and the value in hex is \x31,\xa0,\x0a,\x32 . this hex string is wrong ,the correct hex string is \x31,\x20,\x0A,\x32.

the php server receive string hex is different, our php code receive string in hex is \x31,\xc2,\xa0,\x0a,\x32. the \xc2,\xa0 is not our input character.

we try chrome debug tools catch the post header , found the form data encoding was : data=1%C2%A0%0A2.  "%C2%A0%" this string should be "%20", but i can't found any function can change the form data encoding by the web browser.

finally , i use textarea replace textbox in html file,  then the php server receive right string which we input into the textarea.



all test source as following:
test.html file:
-------------------------------------------------------------------
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>oracle</title>
<script src="jquery-easyui-1.4.2/jquery.min.js"></script>
<script src="jquery-easyui-1.4.2/jquery.easyui.min.js"></script>
<script src="jquery-easyui-1.4.2/locale/easyui-lang-zh_CN.js"></script>
<script src="common.js"></script>
<link href="jquery-easyui-1.4.2/themes/default/easyui.css"
        type="text/css" rel="stylesheet">
<link href="jquery-easyui-1.4.2/themes/icon.css" type="text/css"
        rel="stylesheet">

</head>
<body>

        <div style="margin:20px 0;"></div>
        <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add'" onclick="test_submit()">Add</a><br>
        <input class="easyui-textbox" data-options="multiline:true"  id="test"  style="white-space:pre-wrap;width:200px;height:100px"></input>
</body>
</html>



javascript common.js
-----------------------------------------------------------------------
function test_submit()
{
        var txt=$("#test").textbox("getValue");
        var u_txt=stringToHex(txt);

        $.post("test.php", {
                "data" : txt
        }, function(data) {
              $.messager.alert('error',u_txt+'\n'+data, 'error');
        });

}
function stringToHex(str){
        var val=new Array();
        for(var i = 0; i < str.length; i++){
                var tmp='0'+str.charCodeAt(i).toString(16);
                val.push(tmp.substr(-2));
    }
        return val;
}



php test.php
------------------------------------------
<?php

function str2hex($str) {
        $ret = "";
        for($i = 0; $i < strlen ( $str ); ++ $i) {
                $c = $str [$i];
                $ac = ord ( $c );
                $p = "0" . strval ( dechex ( intval ( $ac ) ) );
                $ret .= substr ( $p, - 2 );
        }
        return $ret;
}

$data=$_POST["data"];
echo str2hex($data);

?>



os: windows server 2008R2  x64 sp1
browser: google chrome 37.0.2062.103
jquery-easyui-1.4.2

 3 
 on: May 25, 2017, 05:33:00 AM 
Started by crosemffet - Last post by bduguay
I know this is an old thread, but how do you enable/disable the button within the datagrid/treegrid?

I have my formatter create the button
Code:
function buttonFormatter(buttonText, row, ca) {
    return '<a href="#" id="btn' + row.id + '" class="e-linkbutton" data-options="width:57">' + buttonText + '</a>';
}
but when I go to disable the button with the following code, nothing happens
Code:
$('#btn' + row.id).linkbutton('disable');

Any help would be appriciated.
Thank you.

 4 
 on: May 24, 2017, 08:32:33 PM 
Started by davistom - Last post by jarry
When set the 'idField' property correctly, the selected row will be remained, no matter you scroll to what page. Please look at this example:
https://www.jeasyui.com/demo/main/index.php?plugin=DataGrid&theme=material&dir=ltr&pitem=Virtual%20Scroll%20View&sort=

 5 
 on: May 24, 2017, 10:17:10 AM 
Started by davistom - Last post by davistom
I set the idField option at datagrid initialization but I think I misconstrued and incorrectly described the behavior I observe. Following is another attempt to describe what I see.

My datagrid rows are retrieved via remote access to a large MySql data table. I use 50 for the pageSize parameter and the datagrid scrolling behavior is as expected. If I select a row on page 1, scroll to another page and then return to page 1 so that the selected row is exposed in the datagrid window, the behavior is also as expected. That is, the row selection is preserved and the selected row is highlighted.

However, when I scroll to and select a row deep in the data table, the behavior is not what I expect and want. Specifically, the selection is preserved if I scroll to a new page then return to the page which contains the selection but the selected row highlighting is not preserved. Shouldn't the selected row highlight be preserved?

 6 
 on: May 24, 2017, 08:17:05 AM 
Started by sectioni - Last post by jarry
The 'sorter' function should be:
Code:
sorter: function (a, b) {                   
     return parseFloat(a) > parseFloat(b) ? 1 : -1;
}
Fore more information please look at this updated example https://jsfiddle.net/1t6vndt4/5/

 7 
 on: May 24, 2017, 03:20:30 AM 
Started by sectioni - Last post by sectioni
Hi,

I have a column with decimal values.
The default sorter doesn't work properly (the decimal values are strings in the json and that's not something i can change right now) so I will need to add a custom sorter.
But I am having problems with sorting direction. I need help doing the sorter.

Check the file size column:
https://jsfiddle.net/1t6vndt4/4/

 8 
 on: May 24, 2017, 12:30:34 AM 
Started by kyytyp - Last post by kyytyp
if i can't use easyui-panel href,Because it affects the layout of my page now and other code,Can't a div be hidden for code operations?

 9 
 on: May 24, 2017, 12:18:54 AM 
Started by davistom - Last post by jarry
You have to set the 'idField' property to indicate the key field name. The selected row will be remained when scrolling rows.

 10 
 on: May 24, 2017, 12:13:46 AM 
Started by jkdoyle - Last post by jarry
Once you get the datagrid object, you can call 'getRowIndex' method to get the special row's index and call 'scrollTo' method to scroll to it.
Code:
var index = grid.datagrid('getRowIndex',...);
grid.datagrid('scrollTo', {
  index: index,
  callback: function(){
    // do something here
  }
});

If you just want to append a new row to the datagrid, please call 'appendRow' method instead of reloading all the rows. Please make sure to download the 'datagrid-scrollview.js' file from https://www.jeasyui.com/extension/datagridview.php

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