Roberto Nicchi
uniGUI Subscriber-
Posts
226 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by Roberto Nicchi
-
Ok, maybe i have a good solution to all this problem. In the form, instead of execute directly a delphi procedure i execute the click JS event of the button that is in the frame Tfrm(pc.activepage.Controls[0]).but.JSInterface.JSCall('click',[]); // Tfrm is the class of the frame that is opened insie a pagecontrol tabsheet. In the button i have defined the JS click event function click(sender, e, eOpts) { var grid = frm.gd; if (grid.editingPlugin.editing) { grid.editingPlugin.completeEdit(); } ajaxRequest(this, '_click', []); } finally i have defined the OnAjaxEvent for the button procedure Tfrm.UniToolButton1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if eventname='_click' then begin if dset.State=dsEdit then msg.Caption:='state=dsedit' else msg.caption:='no dsedit'; end; end; This seems to work in a small demo app; when i press the function key the button JS click event is executed. The cell editor is closed and the dataset state is changed in dsEdit Do you think that this is a good solution ?
-
ok i have the reply to the first question: if (this.grid.editingPlugin.editing) { I miss only the reply to the second question....
-
Ok, i'm almost there i have defined the js event onkeydown as follow function keydown(e, t, eOpts) { if (e.keyCode === 118 || e.keyCode === 119 || e.keyCode===121) { this.grid.editingPlugin.completeEdit(); ajaxRequest(this.grid, '_fkey', ['keyCode='+e.keyCode]); } else { ajaxRequest(this.grid, '_disable_buttons', []); // with this i'll disable the form keydown event. Only the grid } } and the js event store.update as follow function store.update(sender, record, operation, modifiedFieldNames, details, eOpts) { ajaxRequest(this.grid, '_enable_buttons', []); } Is it possible in keydown event to detect if, when the key has been pressed, the editor is active or not ? And is there a js event that i can define to detect if a change has been made using the mouse ? I'm thinking to a dbgrid column with a lookup field. thanks
-
To detect if the dbgrid is the active control could solve the problem. Unfortunately seems that this is not possible...
-
I have found a post where is written that the onenter event can't be implemented for dbgrid. If this is still true i'll find another way ... Simulate OnEnter For Grid - General - uniGUI Discussion Forums
-
I was trying this solution. I have to disable the function keys when the focus enter the grid. I can't simply comment out the code as you did in the example. But i see that the onenter event is not executed for the grid. It's executed for other components (Tuniedit for example) but in the grid it's not executed. Known bug ?
-
Tunidbgrid: how to force changes in current cell are saved ?
Roberto Nicchi replied to Roberto Nicchi's topic in General
Regarding this thing i have rethinked my idea. I thing i'll leave the default behaviour. The user change the cell value and have to press enter or press tab to confirm the data. It's acceptable. Anyway the autopost property, present for checkboxes, could be extended to others comumn types. If possible add this request to the future unigui development. -
Tunidbgrid: how to force changes in current cell are saved ?
Roberto Nicchi replied to Roberto Nicchi's topic in General
I have tryed this workaround and in the example work. Unfortunately in my application i have problems to make it work. The cause seems to be the "bug" i have reported in portal: FSD-4075 Onkeydown executed twice -
I have created the cellkeydown event in that example (see below) but the exception (grid is still in dirty state) is still present. function cellkeydown(sender, td, cellIndex, record, tr, rowIndex, e, eOpts) { if (e.keyCode === 118 || e.keyCode === 119) { sender.editingPlugin.completeEdit(); } }
-
Attached a screenshot of my application. In the form (actually a frame) the user can insert/edit a form of payment. There are some informations like the code, the description and others. There's also a grid, the one in the middle. This grid is connected to a temporary table. When the user has finished to edit data can save or discard changes. If choose to save i have to also save the data from the temporary table saving records into the real table. If press F8 is necessary to save and move to the prior form of payment. If press F9 is necessary to save and move to the next form of payment. In my demo app i have simulated the F8/F9 action.
-
Cannot read property 'setAttribute' of null
Roberto Nicchi replied to Roberto Nicchi's topic in General
Editing data in a Tunidbgrid... In the grid there's a lookup field, numeric fields and checkbox fields. I was trying to reproduce the error in a small demo app but i had no luck so far. -
Attached a demo app the shows the "Grid is in dirty state" exception. Project1.zip
-
I have a random exception working with TuniDbGrid (i think it's related to the grid). Can you understand something from the code below ? UNIGUI Ver. 1.90.0.1551 thanks Cannot read property 'setAttribute' of null O154.originalValue=undefined;_sfv_(O154,0,"0");O154.originalValue=undefined;_sfv_(O154,0,"5");O4FB.rdonly=false;O4FB.unEditable=false;_gsr_(OF3,23,1,true);delete O1C7_Cols;O1C7.refreshColumnCache=true;O1C7.discardColumns(); O543=new Ext.grid.column.Column({ogrid:O1C7,sortable:false,dataIndex:"0",renderer:_rndcll_,rdonly:true,text:"Rata",align:"right",ct:"number",width:35,attr:"{fts:'font-family:Segoe UI Light'}",editor:{xtype:"numberfield",decimalPrecision:0,hideTrigger:true,fieldStyle:"font-family:Segoe UI Light;color:#000000"},unEditable:true});O543.nm="O543";O543.editor.uform=O1C7.uform;O543.editor.focusDisabled=true;O543.editor.isCellEditor=true; O54B=new Ext.grid.column.Column({ogrid:O1C7,sortable:false,dataIndex:"1",renderer:_rndcll_,rdonly:false,text:"Tipo pagamento",width:188,attr:"{fts:'font-family:Segoe UI Light'}",editor:O2E6,uEditor:O2E6});O54B.nm="O54B";O2EA.removeAll(false);O2EA.add({id:"0",val:"RI.BA"});O2EA.add({id:"1",val:"RID"});O2EA.add({id:"2",val:"RIMESSA DIRETTA"});O2EA.add({id:"3",val:"BONIFICO"});O2EA.add({id:"4",val:"CAMBIALE"});O2EA.add({id:"5",val:"ASSEGNO"});O2EA.add({id:"6",val:"CONTANTI"});O2EA.add({id:"7",val:"CONTRASSEGNO"});O2EA.add({id:"8",val:"CARTA DI PAGAMENTO"});O2EA.add({id:"9",val:"MISTO"});O2E6.uniSendValue=true;O2E6.name="1";O54B.editor.focusDisabled=true;O54B.editor.isCellEditor=true; O553=new Ext.grid.column.Column({ogrid:O1C7,sortable:false,dataIndex:"2",renderer:_rndcll_,rdonly:false,text:"Giorni",align:"right",ct:"number",width:55,attr:"{fts:'font-family:Segoe UI Light'}",editor:{xtype:"numberfield",decimalPrecision:0,hideTrigger:true,fieldStyle:"font-family:Segoe UI Light;color:#000000"}});O553.nm="O553";O553.editor.uform=O1C7.uform;O553.editor.focusDisabled=true;O553.editor.isCellEditor=true; O55B=new Ext.grid.column.Column({checkColumn:true,ogrid:O1C7,sortable:false,dataIndex:"3",hidden:true,renderer:_rndcll_,rdonly:false,text:"Rata impon.",align:"center",ct:"boolean",width:85,attr:"{fts:'font-family:Segoe UI Light'}",unEditable:true});O55B.nm="O55B"; O563=new Ext.grid.column.Column({checkColumn:true,ogrid:O1C7,sortable:false,dataIndex:"4",hidden:true,renderer:_rndcll_,rdonly:false,text:"Rata Iva",align:"center",ct:"boolean",width:120,attr:"{fts:'font-family:Segoe UI Light'}",unEditable:true});O563.nm="O563"; O56B=new Ext.grid.column.Column({ogrid:O1C7,sortable:false,dataIndex:"5",renderer:_rndcll_,rdonly:false,text:"% Ripart. impon.",align:"right",cf:"#0.00",ct:"float",width:90,attr:"{fts:'font-family:Segoe UI Light'}",editor:{xtype:"numberfield",decimalPrecision:10,hideTrigger:true,fieldStyle:"font-family:Segoe UI Light;color:#000000"}});O56B.nm="O56B";O56B.editor.uform=O1C7.uform;O56B.editor.focusDisabled=true;O56B.editor.isCellEditor=true; O573=new Ext.grid.column.Column({ogrid:O1C7,sortable:false,dataIndex:"6",renderer:_rndcll_,rdonly:false,text:"% Ripart. Iva",align:"right",cf:"#0.00",ct:"float",width:120,attr:"{fts:'font-family:Segoe UI Light'}",editor:{xtype:"numberfield",decimalPrecision:10,hideTrigger:true,fieldStyle:"font-family:Segoe UI Light;color:#000000"}});O573.nm="O573";O573.editor.uform=O1C7.uform;O573.editor.focusDisabled=true;O573.editor.isCellEditor=true; O57B=new Ext.grid.column.Column({ogrid:O1C7,sortable:false,dataIndex:"7",renderer:_rndcll_,rdonly:false,text:"Tipo scadenza",width:108,attr:"{fts:'font-family:Segoe UI Light'}",editor:O31C,uEditor:O31C});O57B.nm="O57B";O320.removeAll(false);O320.add({id:"0",val:"Giorno esatto"});O320.add({id:"1",val:"Fine mese"});O320.add({id:"2",val:"Giorno fisso"});O31C.uniSendValue=true;O31C.name="7";O57B.editor.focusDisabled=true;O57B.editor.isCellEditor=true; O583=new Ext.grid.column.Column({ogrid:O1C7,sortable:false,dataIndex:"8",renderer:_rndcll_,rdonly:false,text:"Giorno fisso",align:"right",ct:"number",width:79,attr:"{fts:'font-family:Segoe UI Light'}",editor:{xtype:"numberfield",decimalPrecision:0,hideTrigger:true,fieldStyle:"font-family:Segoe UI Light;color:#000000"}});O583.nm="O583";O583.editor.uform=O1C7.uform;O583.editor.focusDisabled=true;O583.editor.isCellEditor=true; O58B=new Ext.grid.column.Column({ogrid:O1C7,sortable:false,dataIndex:"9",hidden:true,renderer:_rndcll_,rdonly:false,text:"RecId",align:"right",ct:"number",width:64,attr:"{fts:'font-family:Segoe UI Light'}",editor:{xtype:"numberfield",decimalPrecision:0,hideTrigger:true,fieldStyle:"font-family:Segoe UI Light;color:#000000"}});O58B.nm="O58B";O58B.editor.uform=O1C7.uform;O58B.editor.focusDisabled=true;O58B.editor.isCellEditor=true;var O1C7_Cols=[O543,O54B,O553,O55B,O563,O56B,O573,O57B,O583,O58B];O1C7.reconfigure(null,O1C7_Cols);O1C7.uniConfigColumns();O543.setElProp({"text-align":"left"},null,0,null,null,"titleEl");O553.setElProp({"text-align":"left"},null,0,null,null,"titleEl");O55B.setElProp({"text-align":"left"},null,0,null,null,"titleEl");O563.setElProp({"text-align":"left"},null,0,null,null,"titleEl");O56B.setElProp({"text-align":"left"},null,0,null,null,"titleEl");O573.setElProp({"text-align":"left"},null,0,null,null,"titleEl");O583.setElProp({"text-align":"left"},null,0,null,null,"titleEl");O58B.setElProp({"text-align":"left"},null,0,null,null,"titleEl");O1CB.load({params:{options:1}});O13C.originalValue=undefined;_sfv_(O13C,0,"RIMESSA DIRETTA 30 GG F.M.");O140.originalValue=undefined;_sfv_(O140,0,"034");O15C.originalValue=undefined;_sfv_(O15C,0,"MISTO");O167.originalValue=undefined;_sfv_(O167,0,"Fine mese");O17E.originalValue=undefined;_sfv_(O17E,0,"Mesi");O184.originalValue=undefined;_sfv_(O184,0,"In percentuale");O2E6.originalValue=undefined;_sfv_(O2E6,0,"");O31C.originalValue=undefined;_sfv_(O31C,0,"");
-
Tunidbgrid: how to force changes in current cell are saved ?
Roberto Nicchi replied to Roberto Nicchi's topic in General
I have done it. Project1.zip -
Tunidbgrid: how to force changes in current cell are saved ?
Roberto Nicchi replied to Roberto Nicchi's topic in General
ok -
Tunidbgrid: how to force changes in current cell are saved ?
Roberto Nicchi replied to Roberto Nicchi's topic in General
Just tryed. Actually i have tryed for all this morning -
Tunidbgrid: how to force changes in current cell are saved ?
Roberto Nicchi replied to Roberto Nicchi's topic in General
No, this doesn't work because the state in not dsEdit. The state wil be dsedit only if the user type the value and exit the cell (with tab for example or click in another component). -
Tunidbgrid: how to force changes in current cell are saved ?
Roberto Nicchi replied to Roberto Nicchi's topic in General
I can try I have a form with some unigui components. One is a TuniDbGrid (let's call it the Xgrid). The xgrid is connected to a mem table (a TdxMemData) The form shows the data of a specific subject (let's say a customer) F10 is defined to execute a procedure that save the data. F8 save data and move to the prior customer, F9 save data and move to the next customer. In the Xgrid the user change a cell (could be a numeric value or a lookup field or whatever you want) and doesn't press tab or click in another component, the focus remain in the cell. If now press F10 or F8 or F9 how can i save in the dataset the data in the cell ? thanks -
If some data is changed in the current cell, is there a way to force the grid to post the data ? I have tryed to use the dataset (if dataset.state=dsedit then dataset post) but seems that the dataset state is not changed if the focus doesn't exit the cell. This lead to an exception later in the app: "Grid is in dirty state. No more updates can be applied." thanks
-
TUniDbGrid: combobox with value/description pair list
Roberto Nicchi replied to Roberto Nicchi's topic in General
Only to say that i have solved using a inmemory table and lookup field. -
Hello, i have a grid column that contains an integer value (the code) and the column have to show the corresponding description. The user can also change the selection so i can't use a calculated field. I would like to do it with a combobox. I see that is possible to assign a combobox editor to the column. The problem is that the TuniCombobox doesn't allow to insert the value for each item, but only the description... Is there an easy way to do it ? Let me know if it's not clear. thanks
-
TUniCombox and TUniDBLookupcombox: items font can't be changed.
Roberto Nicchi replied to Roberto Nicchi's topic in General
This morning didn't work ... I have now cleared everything and tryed again. It works perfectly. The second time is always better If possible fix this problem so there's no need to use this workaround thanks -
TUniCombox and TUniDBLookupcombox: items font can't be changed.
Roberto Nicchi replied to Roberto Nicchi's topic in General
Thanks, possible that this code doesn't have effect if used in a Tuniframe ? -
TUniCombox and TUniDBLookupcombox: items font can't be changed.
Roberto Nicchi replied to Roberto Nicchi's topic in General
This is the same link i have posted. Yes, have tryed. Look at the attached example. I miss something ? thanks Project1.zip -
The items of TUniCombobox and TUniDbLookupCombox are displayed with a font that is not the same to the one that have been set. I have found the post below but seems is not to working. Are you going to fix it ? To reproduce is easy: create a new project, in the main form change the font. Insert a Tunicombobox and create some items. Run the app. The items in the dropdown list have a different font, not sure what is it. Probably Thaoma. Maybe is possible to set somwhere in the application the default font ? Maybe using CSS ? I have looked at the server module and main module but i see nothing. Thanks