EasyUI Forum
June 19, 2024, 03:44:17 PM *
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 cell denied from editing on: January 04, 2014, 08:15:44 AM
Works like a charm !

Thank you very much
2  General Category / General Discussion / Re: Showing 'value' instead 'id' in field of combobox type on edatagrid on: December 17, 2013, 07:51:32 AM
I have come back to this topic for my project and I figured out that maybe this is not the right solution. There was mentioned onBeforeSave event, but maybe marceloparra want something that I understood as my problem too.
I'll try to explain.

I have simple datagrid with some columns and 1 "id" of school column. List of schools is in other table through second request:

Datagrid request: ***php?operation=getPersons (simple select form 1 table)
return name, surname and id_scholl

Combobox editor (school selector) request: ***php?operation=getRequest&type=graduation (simple select from 1 table)
returns id and scholl_name {1,basic scholl,2, college,etc...)

This shows following id_school in datagrid column as on picture no.1

I changed sql query for Datagrid request, and I'v combined select form table persons (datagrid) and table of schools (combobox editor for field in datagrid), at put it to "virtual" column.
Then at datagrid :
 
Code:
     formatter:function(value,row,index){
            return row.school; //Instead of value which is id_school by default in select query of datagrid url
            }

And everything works properly for me as on picture no.2
After editing row, combobox works properly as on picture 3.

With this, I just show school name instead of school ID in datagrid in NON editing row.

I could not solved it directly in datagrid column configuration, Editor of column was not returned (either with edatagrid):
Code:
datagrid{columns[[......
field: colName.....,editor{combobox},
formatter:function(value,row,index){
var ed = $(this).edatagrid('getEditor',{index: index,field: 'colName'}); <------- Nothing returned
            }
...]]...}
3  General Category / General Discussion / Re: Showing 'value' instead 'id' in field of combobox type on edatagrid on: November 25, 2013, 07:50:53 AM
Exactly,
Thank you
4  General Category / General Discussion / Re: Showing 'value' instead 'id' in field of combobox type on edatagrid on: November 17, 2013, 02:38:59 AM
Hey mate,
Same thing I'm trying to solve too. ComboBox editor type in datagrid have to parse data during the datagrid. But If you show 20 rows, there should be 20 sql requests for each combobox id column, to retreive its text, which is insane.

1.Attempt
I'm thinking about parsing this combobox data into 2d array( id,value) variable during page load, "eval" it , and then you use it as just simple variable reference 2darray[<id>], which will return "nombre" text.

2.Attempt (handling on sql site + big workaround in datagrid) - I'm testing the effort right now
In your grid php, sql query, make select from second table (for combobox) too. I mean:
select <columns>concat(id,' ',nombre), as producto_id2<columns> from mainTable grid,productos p where mainTable.producto_id=productos.id
In datagrid 1 column will be hidden, producto_id2 will be editable, and you have to read column producto_id..... not clear right now

I'm not sure too
5  General Category / EasyUI for jQuery / [SOLVED] DataGrid - Set cell denied from editing on: October 21, 2013, 12:40:55 PM
Hello there,
I'v browsed/searched for this topic, no results, for me it seems a little bit special.

Case:
I have datagrid with editable Rows (row.editing = true;). 3 columns are editable (from more) after switching into edit row mode (they have defined editors: datebox,text,datebox)

My target:
I want to prevent 1st two editable columns from editing, and keep just 1 (3rd) editable column because of one condition in row. When condition changes to another value, I want to edit 1st two editable columns and prevent 3rd column from editing.

Is this possible to achieve dynamic editmode for columns  ?

My work:
var ed = $('#xxx').datagrid('getEditor', {index:index,field:'yy'});
$(ed.target).datebox({disabled:true});

ED variable is empty

CellEditing is alternative, but I cannot achieve my target anyway.

EasyUI ver. 1.3.2, JQ 1.8.0

Thank you for your suggestions
6  General Category / EasyUI for jQuery / Re: Using a multi-select combobox in editable datagrid on: October 16, 2013, 03:39:26 AM
Thank you too !
7  General Category / EasyUI for jQuery / Datagrid bad formatting inside tabs on: August 24, 2013, 07:50:35 AM
Hello Community,
I'v searched for my "problem" but I did not found any similar topic to mine. So:

I'm trying to achieve correct looking datagrid inside tabs, but Columns does not autofit.

I have 3 tabs, each tab has its own datagrid. 1st is looking properly but 2nd and 3rd has column headers somehow corrupted.

 
Code:
<div id="tabs" class="easyui-tabs" style="height: auto">
        <div title="tab1" style="padding: 10px">
            <table id="table1"> <!-- DATAGRID -->
            </table>
        </div>
        <div title="tab2" style="padding: 10px;" data-options="cache:false">
            <table id="table2"> <!-- DATAGRID -->
            </table>
        </div>
        <div title="tab3" style="padding: 10px" data-options="cache:false">
            <table id="table3"> <!-- DATAGRID -->
            </table>
        </div>
</div>


I'm attaching screen shot with 1st and then 2nd tab selected.

I'v played with caches too. In my other project I'v solved it by loading external content for each tab after clicking on it. I think somehow could be this attempt solvable too.

DataGrid method "fixColumnSize" does not fix this.
I'v also tried to switch tables to prevent some my mistakes.

jQuery 1.8.0
jEasyUI 1.3.2


Any advices ?

Thank you very much for your support
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!