Jump to content

jrp

uniGUI Subscriber
  • Posts

    123
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by jrp

  1. Hi arilotta, Thank you for the workaround. I have not tried it yet, but looking at your code, I think it will work. I hope someday it will be fixed in UniGUI so programmers can expect same behaviour in UniGUI like in VCL.
  2. Hello, For MVC the benefits would be great if the code is autogenerated instead of hand coded. Too much efforts needed to code by hand. But code/form generator would benefit all kind of programming paradigm. Even more benefits with the Delphi RAD way. Imagine that when we create a database application, we define datasets (sql, which fields shown in grid, which fields included in insert & edit, field labels, default values, etc) and a few clicks later, for each dataset it will autogenerate *.dfm and *.pas of: - a datamodule that contains the dataset - a form with dbgrid to browse, filter and search the dataset - a form to do insert & edit the dataset and those forms are ready to use and customize. This would save time greatly
  3. Thank you Delphi Developer. I tried the demo and succesfuly do the same.
  4. Hello, UniGUI uses different component sets for desktop and mobile. If I want to create an application in desktop and mobile versions (for example http://www.myapplication.comand http://m.myapplication.com), do I have to create 2 separate projects? And what is the hosting strategy for this case? Thank you in advance.
  5. Hello, I have not tried UniGUI again in a few months. Do someone have answers for question no 1 - 3? Thanks
  6. Hello Delphi Developer, The code can activate row editor, but double-clicking the grid still triggers editing.
  7. And how to make RowEditing could be activated programmaticaly only? In other words: how to make double-clicking the grid do not trigger editing?
  8. Wow! I think I'm looking at a desktop application.
  9. Please post more of these The screenshots are inspiring. I'm interested particularly in seeing forms used for data input.
  10. Hello Delphi Developer, I have put Ext.grid.RowEditor.prototype.cancelBtnText = "This is cancel"; Ext.grid.RowEditor.prototype.saveBtnText = "This is update"; in MainForm.Scripts, but it doesn't work. The caption is still Confirm and Cancel.
  11. Hello Delphi Developer, For complex data entry, I would use a separate form like you said. But for simple data entry it is simpler to use grids. And UniDBGrid is very very good grid with built-in row editor functionality. I think question no 2 & 3 is important for good code, because we can have most control over the whole process of receiving input from user, validate it, posting it to the database and also do some processing before and after the post. This will be valuable. For question no 4, I will try it. Thanks
  12. I tried a solution for question 2 with the following concept: UniDBGrid created with ReadOnly:=true; In the OnClick events of the button for editing (eg. btAppend & btEdit), make UniDBGrid.ReadOnly:=false; before calling Dataset.Append/Dataset.Edit In the dataset's AfterPost & AfterCancel events, set UniDBGrid.ReadOnly:=true; In code: procedure TMainForm.UniFormCreate(Sender: TObject); begin {$ifdef COMPILER_14_UP} with FormatSettings do {$endif} begin DateSeparator:='/'; CurrencyFormat:=0; CurrencyString:='$'; end; UniDBGrid1.ReadOnly:=True; end; procedure TMainForm.btEditClick(Sender: TObject); begin if ClientDataSet1.IsEmpty then Exit; UniDBGrid1.ReadOnly:=False; ClientDataSet1.Edit; end; procedure TMainForm.btAppendClick(Sender: TObject); begin UniDBGrid1.ReadOnly:=False; ClientDataSet1.Append; end; procedure TMainForm.ClientDataSet1AfterCancel(DataSet: TDataSet); begin UniDBGrid1.ReadOnly:=True; end; procedure TMainForm.ClientDataSet1AfterPost(DataSet: TDataSet); begin UniDBGrid1.ReadOnly:=True; end; The solution seems to work fine at first, but on the second time you try to do editing by clicking btAppend or btEdit then Ajax error happened: O13.rdonly=false;O60.setDisabled(true);O64.setDisabled(false);O68.setDisabled(false);O78.setText("dsEdit");delete O13_Cols;delete O13.view.cachedColumns; OC7=new Ext.grid.column.Column({ogrid:O13,sortable:false,dataIndex:"0",renderer:_rndcll_,rdonly:false,locked:true,text:"Id No",align:"right",ct:"number",width:94,editor:{xtype:"textfield"}});OC7.nm="OC7";OC7.editor.focusDisabled=true; OC8=new Ext.grid.column.Column({ogrid:O13,sortable:false,dataIndex:"1",renderer:_rndcll_,rdonly:false,text:"Last Name",width:124,editor:O2E});OC8.nm="OC8";O2E.name="1";OC8.editor.focusDisabled=true; OC9=new Ext.grid.column.Column({ogrid:O13,sortable:false,dataIndex:"2",renderer:_rndcll_,rdonly:false,text:"First Name",width:94,editor:O3C});OC9.nm="OC9";O3C.name="2";OC9.editor.focusDisabled=true; OCA=new Ext.grid.column.Column({ogrid:O13,sortable:false,dataIndex:"3",renderer:_rndcll_,rdonly:false,text:"Phone Ext.",width:72,editor:O38});OCA.nm="OCA";O38.name="3";OCA.editor.focusDisabled=true; OCB=new Ext.grid.column.Column({ogrid:O13,sortable:false,dataIndex:"4",renderer:_rndcll_,rdonly:false,text:"Hire Date",cf:"d/m/Y",ct:"datetime",width:112,editor:O88});OCB.nm="OCB";var e=O88;if(e.picker){e.picker.destroy();delete e.picker;};O88.name="4";OCB.editor.focusDisabled=true; OCC=new Ext.grid.column.Column({ogrid:O13,sortable:false,dataIndex:"5",renderer:_rndcll_,rdonly:false,text:"Salary",align:"right",cf:"$$0,0.00",ct:"float",width:86,editor:{xtype:"textfield"}});OCC.nm="OCC";OCC.editor.focusDisabled=true; OCD=new Ext.grid.column.Column({ogrid:O13,sortable:false,dataIndex:"6",renderer:_rndcll_,rdonly:false,text:"Work Start",cf:"H:i",ct:"time",width:71,editor:O8C});OCD.nm="OCD";O8C.name="6";OCD.editor.focusDisabled=true; OCE=new Ext.grid.column.Column({ogrid:O13,sortable:false,dataIndex:"7",renderer:_rndcll_,rdonly:false,locked:true,text:"City",width:88,editor:O32});OCE.nm="OCE";O32.name="7";OCE.editor.focusDisabled=true;var O13_Cols=[OC7,OC8,OC9,OCA,OCB,OCC,OCD,OCE];O13.reconfigure(null,O13_Cols);O13.uniConfigColumns();OC7.setElProp({"text-align":"left"},null,0,null,null,"titleEl");OC8.setElProp({"text-align":"center"},null,0,null,null,"titleEl");OCC.setElProp({"text-align":"left"},null,0,null,null,"titleEl");_sge_(O13,0,0,true); What could be wrong?
  13. Hello, I had just discovered UniGUI and currently evaluating it. UniGUI is very cool! I can use Delphi, but I don't know anything about developing web application. Now UniGUI make things looks familiar and easy. I hope that I never have to learn another programming language to develop web applications. I have questions about UniDBGrid. Please download the attachment to understand my questions better. It is a slightly modified UniGUI GridEditors - Row Editor Demo I use Delphi Berlin Starter & UniGUI 1.0.0.1385 Trial. Now the questions: 1. When I'm editing a record by double-clicking the grid, UniDBGrid1.DataSource.State is dsBrowse. Is this a bug? Because when I do editing by clicking the edit button in the UniDBNavigator1 or by code, UniDBGrid1.DataSource.State is dsEdit (correct behaviour). 2. How to make it so that UniDBGrid1 can't be edited by double click but can be edited by code (eg. by clicking btAppend or btEdit) ? 3. How to make the Confirm and Cancel button dissapear when editing in RowEditor mode? I want to use another buttons outside the grid to do Post and Cancel by myself because I have several things to do before & after post (I can't use ClientDataset1.BeforePost & AfterPost events because the code will look bad). 4. How to change the Caption and give icons to the Confirm and Cancel buttons? Thanks in advance
×
×
  • Create New...