Show Posts
|
Pages: [1] 2 3
|
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 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 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 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
|
|
|
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 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
|
|
|
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 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
|
|
|
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... $('<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
|
|
|
|