EasyUI Forum
May 15, 2024, 07:46:42 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: [1]
1  General Category / EasyUI for jQuery / Re: Datagrid: Set a Column editable on: March 18, 2014, 11:37:07 PM
Yes i want achieve cell editing, although not for a single field, but for the whole column.

lets say the datagrid has columns 1 to 5.
I want col 3 and 4 to be editable, with a input field in every single rows.
But the editor should not just appear when clicking a button or in a cell, the editors should be ready at the start, for the whole column.

2  General Category / EasyUI for jQuery / Datagrid: Set a Column editable on: March 18, 2014, 08:47:01 AM
Hi all,

i want to have a datagrid, with two columns in which every field is editable.
I just find examples about editing rows, but not columns.
How would i do this?

And is there a option, to set a validator to all the fields ( like field 1 is lesser then field 2 ), so if I click a save button, the validator is fired an every row will be validated on it's own.

Thanks.
3  General Category / EasyUI for jQuery / Re: Sorting in Datagrid on: March 10, 2014, 03:04:51 AM
Thanks a lot.

I didn't notive to set this parameter to false.

Topic is SOLVED !!!
4  General Category / EasyUI for jQuery / Re: Prevent click on the same linkbutton in group on: March 07, 2014, 03:18:21 AM
hi,

just diable your botton isnide your click event:

$('#btn').linkbutton('disable');
5  General Category / EasyUI for jQuery / Sorting in Datagrid on: March 07, 2014, 03:10:14 AM
Hi all,

when i enable the sorting in my datagrid, nothing happens, when i click the sortable column.
Do i have to implent the sort on my own?


Code:
<script>
$(function(){
      $('#Disp_Tolerances_grid').datagrid({
        singleSelect:false,
        idField:'FLEV',
        data: my_disp_tol,
        columns:[[
          {field:'FLEV',title:'Filter Level',rowspan:2,width:62},
          {title:'Global Data',colspan:2},
          {title:'OD Data',colspan:2},
          {field:'USER',title:'User',rowspan:2,width:100},
          {field:'DATE',title:'Date',rowspan:2,width:115}
      ],[
          {field:'FROMGL',title:'From',width:70,[b]sortable:true[/b]},
          {field:'TOGL',title:'To',width:70},
          {field:'FROMOD',title:'From',width:70},
          {field:'TOOD',title:'To',width:70}

        ]]
      });
    });
  </script>

  <table id="Disp_Tolerances_grid" ></table>
6  General Category / EasyUI for jQuery / Re: Panel resize when browser window size changes on: March 07, 2014, 02:29:54 AM
Thanks a lot.
I has the same idea, but I thought there might be a parameter or something within the panel i didn't see  Smiley

But works fine for me.
Thanks  Smiley
7  General Category / EasyUI for jQuery / Panel resize when browser window size changes on: March 07, 2014, 01:20:44 AM
Hi all,

i have the following panel:

Code:
<body>

<div id="p" class="easyui-panel" title="My Panel" data-options="collapsible:true">
<p>Panel Content.</p>
<p>Panel Content.</p>
<p>Panel Content.</p>
        </div>
<p>asdasdasdasda</p>
<p>Padasdadasdadasd</p>
</body>

When i now open the browser everything is fine and it fits perfectly
The Problem is, when i resize the browser window, the panel just don't resize.

see images small and big.jpg

What can i do the resize that panel?

The Problem is inside the panel: When it's generated it appears like this:

<div class="panel" style="width: auto; display: block;">
      <div class="panel-header" style="width: 517px;">
      <div title="" class="easyui-panel panel-body" id="p" style="width: 527px; height: auto;" data-options="collapsible:true">
</div>

If it would be possible to change this to width:auto it would work.
But i can't figure it out?

Any help, thanks.
8  General Category / EasyUI for jQuery / Re: Simple implementation of Row Editing in DataGrid on: March 04, 2014, 04:17:55 AM
sorry can't open your link,
but u should do the following like in examples:


Code:
  for the content of your combobox:

var products = [
    {productid:'FI-SW-01',name:'Koi'},
    {productid:'K9-DL-01',name:'Dalmation'},
    {productid:'RP-SN-01',name:'Rattlesnake'},
    {productid:'RP-LI-02',name:'Iguana'},
    {productid:'FL-DSH-01',name:'Manx'},
    {productid:'FL-DLH-02',name:'Persian'},
    {productid:'AV-CB-01',name:'Amazon Parrot'}
];

Code:
  for defining the datagrid.

$(function(){
$('#tt').datagrid({
title:'Editable DataGrid',
iconCls:'icon-edit',
width:660,
height:250,
singleSelect:true,
idField:'itemid',
url:'data/datagrid_data.json',
columns:[[
{field:'itemid',title:'Item ID',width:60},
{field:'productid',title:'Product',width:100,
formatter:function(value){
for(var i=0; i<products.length; i++){
if (products[i].productid == value) return products[i].name;
}
return value;
},
editor:{
type:'combobox',
options:{
valueField:'productid',
textField:'name',
data:products,
required:true
}
}
}, .....



as you can see it uses the products json as data for the combo.
This works fine with me.

you find the example right here: http://www.jeasyui.com/tutorial/datagrid/datagrid12.php
9  General Category / EasyUI for jQuery / Re: how can have more than one feild on: March 04, 2014, 04:10:38 AM
you can find your answer right in the docu:
Code:
<table class="easyui-datagrid" style="width:400px;height:250px"
        data-options="url:'datagrid_data.json',fitColumns:true,singleSelect:true">
    <thead>
        <tr>
            <th data-options="field:'code',width:100">Code</th>
            <th data-options="field:'name',width:100">Name</th>
            <th data-options="field:'price',width:100,align:'right'">Price</th>
        </tr>
    </thead>
</table>
10  General Category / EasyUI for jQuery / Editable Datagrid with Validators on: March 04, 2014, 04:00:01 AM
Hi Experts,

how would you manage it, to get a editable datagrid with fields "from" and "to", which both should a validator like "from" must be less equal to field "to"

I did the following:


Code:
$.extend($.fn.validatebox.defaults.rules, {
$.extend($.fn.validatebox.defaults.rules, {
   from: {
        validator: function(value, param){
            var ed1 = $('#Tolerances_grid').datagrid('getEditor', {index:my_single_update_index,field:'TO'});
            var to_value = $(ed1.target).val()
            return to_value >= value;
        },
        message: 'From must be lesser than or equals To.'
    },
   to: {
        validator: function(value, param){
            var ed2 = $('#Tolerances_grid').datagrid('getEditor', {index:my_single_update_index,field:'FROM'});
            var from_value = $(ed2.target).val()
            return from_value <= value;
        },
        message: 'To must be greater than or equals From.'
    }
});   

And here is the field defintion:

Code:
          {field:'FROM',title:'From',width:70, editor:{
                                               type:"validatebox",
                                               options:{
                                                 validType:"from[]"
                                              }
                                           }},
          {field:'TO',title:'To',width:70, editor:{
                                              type:"validatebox",
                                              options:{
                                                 validType:"to[]"
                                              }
                                           }},

The code is working fine, but I think it can be much easier, with a row validator perhaps?
If yes, can u give me simple example ?

And i don't like this lines here:
Code:
var ed2 = $('#Tolerances_grid').datagrid('getEditor', {index:my_single_update_index,field:'FROM'});
var from_value = $(ed2.target).val()

I wonder, why i can't use the action getValue() from the editor to get value?

Any ideas?

Thanks.
11  General Category / EasyUI for jQuery / Re: Hope there is an option for combobox to show checkbox on: November 15, 2013, 08:05:35 AM
Hi,

you can easy achieve this with the normal combo like that:

Code:
	<select id="cc2" style="width:150px"></select>
    <div id="sp">
        <div style="color:#99BBE8;background:#fafafa;padding:5px;">Select a language</div>
        <input type="checkbox" name="lang" value="01"><span>Java</span><br/>
        <input type="checkbox" name="lang" value="02"><span>C#</span><br/>
        <input type="checkbox" name="lang" value="03"><span>Ruby</span><br/>
        <input type="checkbox" name="lang" value="04"><span>Basic</span><br/>
        <input type="checkbox" name="lang" value="05"><span>Fortran</span>
    </div>

Code:
            $('#cc2').combo({
                required:true,
                editable:false,
multiple:true
            });
           $('#sp').appendTo($('#cc2').combo('panel'));
           $('#sp input').click(function(){
var my_text = '';
var my_val = '';
   
$('#sp input').each(function(){
if ($(this).is(":checked")) {
var v = $(this).val();
var s = $(this).next('span').text();

my_text == '' ? my_text = s : my_text += ','+s;
my_val  == '' ? my_val = v : my_val += ','+v;
}
});

$('#cc2').combo('setValue', my_val).combo('setText', my_text);
            });
12  General Category / EasyUI for jQuery / Re: Enhance Multiple Combotree with header Panel on: November 11, 2013, 02:21:21 AM
thank you very much, its working :-)
13  General Category / EasyUI for jQuery / Enhance Multiple Combotree with header Panel on: November 08, 2013, 06:51:23 AM
Hi everybody,

i did the following:

Code:
                var my_panel = $('#cc').combo('panel');

$( my_panel ).panel({   
title:'My Panel',
tools:[{
iconCls:'icon-add',
handler:function(){alert('new')}
},{
iconCls:'icon-save',
handler:function(){alert('save')}
}]

});

which leads to this result:

see attached image

is it possible to get the icons working?
Cause if i click one of those icons, nothing happens and the tree gets closed, instead of showing me the alert message.

14  General Category / EasyUI for jQuery / Combotree without using JSON on: November 04, 2013, 06:54:06 AM
Hi everybody,

ist there a way to use the combotree with multiple select, without using JSON?

Code:
<select id="cc" class="easyui-combotree" style="width:200px;"
        data-options="url:'myjosnfile',required:true">
</select>

I would like to use this, with some fixed strucutre of <ul><li> inside the HTML, but i can't manage it getting the data out of the UL LI structure.

Thanks.

Update: It got it running that way:
Even the getChecked is working :-)

Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>jQuery EasyUI</title>
<link rel="stylesheet" type="text/css" href="easyui.css">
<link rel="stylesheet" type="text/css" href="icon.css">
<script type="text/javascript" src="jquery-latest.js"></script>
<script type="text/javascript" src="jquery.easyui.min.js"></script>
    <script>
        $(document).ready(function() {
            $('#cc').combotree('loadData', [{
id: 1,
text: 'Level1',
children: [{
id: 11,
text: 'Level2a',
children: [{
id: 21,
text: 'Level3a'
}, {
id: 22,
text: 'Level3b'
}]
},{
id: 12,
text: 'Level2b'
}]
}]); required: true
        });

    </script>
</head>
<body>
    <span>Select:</span>
    <select id="cc" class="easyui-combotree" style="width:150px;" multiple="true" onlyLeafCheck="true"></select>
<a href="javascript:void(0)" onclick="getChecked()">GetChecked</a>
<script>
function getChecked(){
var nodes = $('#cc').combotree('tree');
var mytree = nodes.tree('getChecked');
        var s = '';
var s = '';
for(var i=0; i<mytree.length; i++){
if (s != '') s += ',';
s += mytree[i].text;
s += mytree[i].id;
}
alert(s);
}

</script>
</body>
</html>
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!