EasyUI Forum
October 15, 2025, 10:55:05 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: Select row from subgrid on: January 20, 2025, 12:30:11 PM
Thanks jarry !- works great

one minor typo, subgrid needs to be subgrid1

Code:
const row = $('#subgrid1').datagrid('getSelected');
2  General Category / EasyUI for jQuery / Select row from subgrid on: January 19, 2025, 03:56:55 AM
Hello

I have a datagrid and subgrid as below
Code:
var conf = {

options:{
fitColumns:true,
toolbar:'#toolbar',
columns:[[
{field:'name',title:'name',width:12},
{field:'amt1',title:'amt1',width:10,align:'right'},
{field:'amt2',title:'amt2',width:10,align:'right'},
{field:'total',title:'Total',width:10,align:'right',
styler: function(value,row,index){     
if (value.charAt(0) == '-'){
return 'color:red;';}
}},
{field:'adjust',title:'Adjust',width:10,align:'right',
styler: function(value,row,index){     
if (value.charAt(0) == '-'){
return 'color:red;';}
}},
{field:'balance',title:'Balance',width:10,align:'right',
styler: function(value,row,index){     
if (value.charAt(0) == '-'){
return 'color:red;';}
}},
]],
},

subgrid:{
options:{
fitColumns:true,
singleSelect:true,
autoUpdateDetail:false,
url:'scripts/database/get_costs.php',
foreignField:function(row){
var dp = $('#yearCombo').combobox('getValue');
                    return {
                        name:row.name,
                        year:dp
                    }},
columns:[[
{field:'date',title:'Date',width:8},
{field:'cst1',title:'Cost 1',width:7,halign:'center',align:'right',
styler: function(value,row,index){     
                if (value.charAt(0) == '-'){
      return 'color:red;';}
        }},
{field:'cst2',title:'Cost 2',width:7,halign:'center',align:'right'},
{field:'total_cst',title:'Total',width:7,halign:'center',align:'right'},
                        ]],
}
}
};

I have a form to to edit the values from the sub grid, however this enatils adding a button to each subgrid line

Is there a way to get the row values from a selected sub grid line, without adding a button on each sub grid line..., instead by using a button on the toolbar

Thank you
3  General Category / EasyUI for jQuery / Re: Styler not working on Subgrid on: January 19, 2025, 03:51:37 AM
Please see below additional code in the hope this will help

Code:
var conf = {

options:{
fitColumns:true,
toolbar:'#toolbar',
columns:[[
{field:'name',title:'name',width:12},
{field:'amt1',title:'amt1',width:10,align:'right'},
{field:'amt2',title:'amt2',width:10,align:'right'},
{field:'total',title:'Total',width:10,align:'right',
styler: function(value,row,index){     
if (value.charAt(0) == '-'){
return 'color:red;';}
}},
{field:'adjust',title:'Adjust',width:10,align:'right',
styler: function(value,row,index){     
if (value.charAt(0) == '-'){
return 'color:red;';}
}},
{field:'balance',title:'Balance',width:10,align:'right',
styler: function(value,row,index){     
if (value.charAt(0) == '-'){
return 'color:red;';}
}},
]],
},

subgrid:{
options:{
fitColumns:true,
singleSelect:true,
autoUpdateDetail:false,
url:'scripts/database/get_costs.php',
foreignField:function(row){
var dp = $('#yearCombo').combobox('getValue');
                    return {
                        name:row.name,
                        year:dp
                    }},
columns:[[
{field:'date',title:'Date',width:8},
{field:'cst1',title:'Cost 1',width:7,halign:'center',align:'right',
styler: function(value,row,index){     
                if (value.charAt(0) == '-'){
      return 'color:red;';}
        }},
{field:'cst2',title:'Cost 2',width:7,halign:'center',align:'right'},
{field:'total_cst',title:'Total',width:7,halign:'center',align:'right'},
                        ]],
}
}
};
4  General Category / EasyUI for jQuery / Styler not working on Subgrid on: January 11, 2025, 02:43:11 PM
Hello

I have a nested Grid

The following styler works fine on the main grid, but not the sub grid

Code:
columns:[[
{field:'adjust',title:'Adjust',width:10,align:'right',
          styler: function(value,row,index){     
      if (value.charAt(0) == '-'){
                    return 'color:red;';}
}},
]],

Any suggestions why ??

Thank you
5  General Category / EasyUI for jQuery / Re: Saving passed value to variable on: December 31, 2024, 08:42:52 AM
Solved

var name = $('#name').val();



6  General Category / EasyUI for jQuery / Saving passed value to variable on: December 31, 2024, 08:15:48 AM
Hello

I have the following

Code:
function doSearch(){
$('#dg').datagrid('load',{
name: $('#name').val(),
});
}

Which works well ie passed the parameters to server.

How would I save the parameter value to a var ??

Thank you

7  General Category / EasyUI for jQuery / Re: Datagrid in a Window on: December 27, 2024, 03:02:55 AM
Thank you Jega, your replies were very helpful, just what I needed to resolve my questions !
8  General Category / EasyUI for jQuery / Datagrid in a Window on: December 26, 2024, 05:18:45 AM
Hello

I have the following function, which is called from a main datagrid to display a list of possible items
Code:
function addItems(){
var row = $('#dg').datagrid('getSelected');
if (row){
$('#win').window({
width:500,
height:200,
title:'Item Selection',
modal:true
});
$('#dgn').datagrid({
singleSelect:false,
url:'get_items.php?item='+row.item,
columns:[[
{field:'item',title:'Item',width:150},
{field:'description',title:'Description',width:150},
       {field:'ck',title:'Select',checkbox:true},
]]
});
}
}
I have the following problems / questions

How do i prevent the checkbox from being displayed as a title field... title:'Select' doesn't seem to work

How do I prevent the top row "titles" scrolling with the returned data ?

Is it possible to add a toolbar to a datagrid within a window ?

I would like to show a running count of items selected in either the toolbar or Window Title bar ?

Any guidance would be appreciated

Thank you

9  General Category / EasyUI for jQuery / Re: datagrid - format a value on: December 15, 2024, 01:37:00 PM

If you pull Open_Amt from a database, the format in in your sql so json is already formatted Huh

Great Idea - Thanks !
10  General Category / EasyUI for jQuery / datagrid - format a value on: December 15, 2024, 12:02:13 PM
Hello

I have a datagrid defined as below
                        
Code:
columns:[[
    {field:'Open_Amt',title:'Amt',width:5, align:'right'},
    {field:'Currency',title:'Cur',width:5}
]],

Currently, Open_Amt format shows as 12345.5

I would like to format value this to show 12,345.50

ie always show 2 places after the decimal point and also show thousands separator

Suggestions appreciated

Thank you


11  General Category / EasyUI for jQuery / Form Load - First Array Element on: December 31, 2023, 05:31:09 AM
Regarding form data

In my case, the data returned is always a object, ie
$('#fm').form('load', [{name: 'xxx}]);

example of returned data
[
{"Company":"Company 1","Phone":"01234 567890","Email":"jim@yahoo.com"}
{"Company":"Company 2 ,"Phone":"01234 012345","Email":"bill@yahoo.com"}
]

I would like to use the email address, of the first element of the returned array data (in the above example "jim@yahoo.com" in a form field.

Suggestions appreciated

Thank you


12  General Category / EasyUI for jQuery / Re: Keeping textbox value and screen in sync on: July 04, 2021, 07:57:48 AM

setText and setValue does this trick

$(d).textbox('setText', 99).textbox('setValue', 99);
13  General Category / EasyUI for jQuery / Keeping textbox value and screen in sync on: July 04, 2021, 03:01:25 AM
Inorder to keep a textbox value and the displayed value in sync, I need to issue 2 statements

        // As a test - populate the value with 99
        $(this).find("input[name='seq1']").attr("value",99);
        // Value changes but screen doesn't update

        // Using textbox method updates the screen but not the value
        $("#seq1").textbox('setText', 99);

Is there a way in which both the value and screen can be updated with one statement ?

Thank you

14  General Category / EasyUI for jQuery / Re: Maintaining EasyUI Formating on: June 22, 2021, 11:58:30 AM
Hi

Thanks for the example..

I'm now trying to set a value (using the "setvalue" method) to the qty0 textbox,  on name change

ie...

Code:
      $('<input>').attr('name','name'+counter).appendTo(td).textbox({
        onChange: function(value){
          console.log('changed:'+value);
      [b] $('#qty0').textbox('setValue', "TEST DATA");[/b] // <--- This doesnt seem to work ???
        }
      });

What am i doing wrong ?

Thank you
15  General Category / EasyUI for jQuery / Re: Maintaining EasyUI Formating on: June 19, 2021, 05:43:39 AM
Hello

Removig -  class="easyui-textbox" from my input statement resolves the problem, however thw text boxes revert back to loosing the EasyUI formating

Ie back where i started - Is there a different solution ??

Thank you
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!