EasyUI Forum
May 20, 2024, 11:30:07 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
1  General Category / EasyUI for jQuery / Re: Easyui-numberbox how to support the value like "0001" on: May 20, 2014, 07:22:17 PM
You need to custom the 'formatter' and 'parser' functions. Try the code below:
Code:
<input class="easyui-numberbox" value="1" data-options="
formatter:function(v){
var s = new String(v||'');
var prefix = '';
for(var i=0; i<4-s.length; i++){
prefix += '0';
}
return prefix+s;
},
parser:function(s){
return parseInt(s)||0;
}
">

I use:
Code:
$("#end_number").numberbox({
    required:true
    formatter:function(v){
var s = new String(v||'');
var prefix = '';
for(var i=0; i<4-s.length; i++){
prefix += '0';
}
return prefix+s;
},
parser:function(s){
return parseInt(s)||0;
}
});


how can only input number(0-9 like  001 or 05 or 0009 or 0000010 ...),

The 0 number is not fixed, thant can start with 0 or 00..?


My english is poor, so you maybe know wrong what i mean in to top(for(var i=0; i<4-s.length; i++)).

 thanks!
2  General Category / EasyUI for jQuery / Easyui-numberbox input how to start letter whith 0 or 00 or 00000... on: May 20, 2014, 06:37:42 AM
When i input 0001, then it changed 1.
3  General Category / EasyUI for jQuery / (resolved) form.serialize() can't get the combotree and combobox! on: May 11, 2014, 07:16:04 AM
Code:
<input id="pid" name="pid" value="{$info.pid|default='0'}"/>
...
$('#pid').combotree({
    url: '/admin.php?s=/MDepartment/getJson',
    loadFilter: treeFilter,
    required: true
});
$('#level').combobox({
    data: dl.level,
    //required: true
});
$('#status').combobox({
    data: dl.status,
    //required: true
});
...

    var query = form.serialize();

 alert(query);  // can't display pid name and value
    $.post(target,query).success(function(data){

I use form.serialize() to get the form data!

alert print:
name=%E5%89%8D%E9%BB%84%E5%BA%97&tel=0519-89681772&addr=%E5%89%8D%E9%BB%84%E9%95%87%E6%99%AF%E5%BE%B7%E8%A5%BF%E8%B7%AF52%E5%8F%B7&Location_X=0.000000&Location_Y=0.000000&sort=17&id=17
alert(query);  // can't display the "pid" name and value (like ...pid=100&...)

I have resolved, the form tag position error!
4  General Category / EasyUI for jQuery / Re: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data on: May 10, 2014, 05:01:27 AM
You need to define the loadFilter function to convert your original data to standard tree data. Please refer to this topic http://www.jeasyui.com/forum/index.php?topic=1265.0

Ok, Thanks!
5  General Category / EasyUI for jQuery / Re: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data on: May 10, 2014, 04:10:31 AM
For some security reasons, cross-domain accessing is denied. Please try to move the resource files to your own domain.

Thanks, but i have a little problem yet:
Code:
...
editor: {
            type: 'combotree',
            options: {
                url: 'http://e.chinaxiaogao.com/admin.php?s=/MDepartment/getJson',
            }
...

My url return json is not standard  combotree data:
[{"id":"100","name":"门店" ...

I want to chang  "name" to "text" (chang in eayui html, not in php),  it become to a stand combotree data. How to do?

treegrid can define:   idField:'id' treeField:'name', and combotree how to do?

thanks!
6  General Category / EasyUI for jQuery / JSON.parse: unexpected end of data at line 1 column 1 of the JSON data on: May 10, 2014, 02:37:00 AM
editor in treegrid load remote json error

Quote
...
        {field: 'pid', title: '上级',  align: 'center', width: 100, editor: {
            type: 'combotree',
            options: {
                //url: '/admin.php?s=/MDepartment/getJson',
                url: 'http://www.jeasyui.com/demo/main/tree_data1.json',
                //valueField: "value", textField: 'name',
            }
         }},
...

Please see the attachments

thinks a lot!
7  General Category / EasyUI for jQuery / Aabout one iframe refresh other iframe datagrid ! on: April 25, 2014, 12:30:07 AM
Hi all.

have 2 tab:
a tab --- title: "内容"
Code:
$(function(){
    var context = this;
    var $grid = $('#article_grid');
    var viewDialog;
    var selectedMenuId, selectedMenuText;


        $grid.datagrid({
        title: '文章列表',
...
});

b tab code below:
$('#art_submit').click(function(){


            var tab = parent.$('#tabs').tabs('getTab', '内容');  // get selected panel
            parent.$('#tabs').tabs('select', '内容');

            alert(tab.find('iframe').get(0).contentWindow.document.getElementById('btn-group').innerHTML);
            //alert: 文章 编辑...

            alert(tab.find('iframe').get(0).contentWindow.document.getElementById('article_grid'));
            // alert: [object HTMLTableElement]

            tab.find('iframe').get(0).contentWindow.document.getElementById('article_grid').datagrid('reload');
            // no alert and tips:TypeError: tab.find(...).get(...).contentWindow.document.getElementById(...).datagrid is not a function
}

8  General Category / EasyUI for jQuery / Re: How to save treegrid editor? on: April 23, 2014, 06:23:40 PM
Who know?
9  General Category / EasyUI for jQuery / Re: How to save treegrid editor? on: April 22, 2014, 09:09:19 AM
And now i use the code follow can get the change data:
..
$('#MTitle #grid').treegrid("endEdit", row.id);
var json = $('#MTitle #grid').treegrid("find", row.id);
alert(JSON.stringify(json));
editingIdTitle = undefined;
..

Have any other solution?

10  General Category / EasyUI for jQuery / How to save treegrid editor? on: April 22, 2014, 08:31:09 AM
...
                {field: 'id', title: 'ID编号', width: 50, align: 'center'},
                {field: 'name', title: '名称', width: 150, align: 'left',  editor:'text'},
...
//save change
function acceptTitle(){
  
    //if datagrid  edtor i can use
    var rows = $('#MDepartment #grid').datagrid('getChanges');
    alert(JSON.stringify(rows[0]))

   //if treegrid editor
   var rows = Huh
  
    /*var row = $('#MTitle #grid').treegrid('getSelected');
    var ed = $('#MTitle #grid').treegrid('getEditor', {id: row.id,field: 'name'});
    var value = $(ed.target).text('getValue');
    alert(value);*/
}
...
11  General Category / EasyUI for jQuery / Re: combotree in row editor can define value and text property ? on: April 21, 2014, 07:27:25 PM
Please use loadFilter function to convert your data to standard tree data.

Thank you your solution!

But now, I write the code follow, don'nt work fine:
...
                {field: 'id', title: 'ID编号', width: 50, align: 'center'},
                {field: 'name', title: '名称', width: 150, align: 'left',  editor:'text'},
                {field: 'pid', title: '上级', width: 150, align: 'center', editor: {
                        type: 'combotree',
                        optons : {
                            //url: '{:U("MDepartment/getJson")}',
                           url: 'http://www.jeasyui.com/demo/main/tree_data1.json',
                          
                            //valueField: "value", textField: 'name',  // And i hope combotree suport textField property
                        }
                    }},
...

When i edit the row, the combotree in the editor cang loading remote json.
Please see the attachment (100 is the field "pid" value);


 
12  General Category / EasyUI for jQuery / Re: combotree in row editor can define value and text property ? on: April 21, 2014, 08:35:02 AM
You do not need to define 'valueField' and 'textField' in combotree plugin. The field value and display text will be auto retrieved from the drop-down tree.



Thanks you reply.

I see the demo.
the loading json:
[{
   "id":1,
   "text":"My Documents",
   "children":[{
      "id":11,
      "text":"Photos",
      "state":"closed",
      "children":[{
         "id":111,
         "text":"Friend"
      },{
         "id":112,
         "text":"Wife"
      },{
         "id":113,
         "text":"Company"
      }]
   },
...

BUT mine like:
[{
   "id":1,
   "name":"My Documents",  //this field. mine is "name" not "text"
   "children":[{
      "id":11,
      "text":"Photos",
      "state":"closed",
      "children":[{
         "id":111,
         "text":"Friend"
      },{
         "id":112,
         "text":"Wife"
      },{
         "id":113,
         "text":"Company"
      }]
   },
...
13  General Category / EasyUI for jQuery / combotree in row editor can define value and text property ? on: April 21, 2014, 01:38:11 AM
..
{field: 'pid', title: '上级', width: 150, align: 'center', editor: {
                        type: 'combotree',
                        optons : {
                            url: '{:U("MDepartment/getJson")}',
                            valueField: "value", textField: 'name',
                        }
}},
...
Can't loading url data

ask:
can define value and text property ?

14  General Category / General Discussion / Re: 终于完美实现了 combobox 汉字拼音检索, 英文检索也支持, 并且效果更好 on: April 20, 2014, 05:59:40 AM
我收下了啊,十分感谢分享
15  General Category / General Discussion / Re: 建议 layout 收缩时, 自动把title显示在 expandPanel 上 on: April 19, 2014, 07:44:20 PM
layout收缩时, 会显示一个 expandPanel, 但是看起来空荡荡的
建议把region的title显示在expandPanel上, 或者再增加一个属性, 如 collapsedTitle , 用于定制 expandPanel 的 title

虽然论坛里有解决方案, 但是这个功能很实用, 建议成为 easyui 未来版本的默认功能


论坛里的对中文支持不太好,英文标题没问题

Title is showed in expandPanel(stworthy give the solution in this bbs), not better for chinese.
Pages: [1] 2 3
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!