Jump to content

Sherzod

Moderators
  • Posts

    19725
  • Joined

  • Last visited

  • Days Won

    639

Everything posted by Sherzod

  1. HI adragan. If I understand correctly, you can try Ext.tip.ToolTip : fo all columns: var tip = Ext.create('Ext.tip.ToolTip', { target: Ext.get(yourGridJSName.headerCt.id), html: '<b>H</b>int' }); for a particular column: var tip = Ext.create('Ext.tip.ToolTip', { target: Ext.get(yourGridJSName.columnManager.columns[columnIndex].titleEl).id, html: '<b>H</b>int' }); for example: yourGridJSName - O18, columnIndex - 1 Try Best regards...
  2. Hi uniguibbs. One of the solutions: Try add afterrender on panel function afterrender(sender, eOpts) { Ext.get(sender.id + "-body").setStyle("border-left", 0); Ext.get(sender.id + "-body").setStyle("border-right", 0); }
  3. Sorry Ronny Encarnacion. Then I do not understand the question ... Best regards
  4. http://forums.unigui.com/index.php?/topic/3992-hideremove-the-form-border/&do=findComment&comment=19269
  5. Hi you can so: MainForm -> ClientEvents -> ExtEvents -> add window.afterrender Try function window.afterrender(sender, eOpts){ Ext.get(sender.id).el.setStyle("padding", 0); Ext.get(sender.id).el.setStyle("border-width", 0); } Sincerely
  6. Sorry one more clarification ... If only panel, or groupbox it can be a single command: include Ext.FocusManager.enable (); Then onblur event will work! But here there is a group onblur ... Sincerely
  7. Hi KingOrmon. can will help (you may have already have looked these links...) http://stackoverflow.com/questions/19989389/can-we-load-a-dfm-file-for-a-form-at-runtime http://stackoverflow.com/questions/3163586/best-way-to-save-restore-a-form-foss
  8. Hi Ronny Encarnacion. If I understand correctly, you want to get all captions on items ... If so, you can use a recursive approach: procedure ProcessMenu(AMenu: TUniMenuItem; AMemo: TUniMemo); procedure TMainForm.ProcessMenu(AMenu: TUniMenuItem; AMemo: TUniMemo); var i: integer; begin for i := 0 to AMenu.Count - 1 do begin AMemo.Lines.Add(AMenu[i].Caption); ProcessMenu(AMenu[i], UniMemo1); end; end; procedure TMainForm.UniButton1Click(Sender: TObject); begin ProcessMenu(UniMainMenu1.Items, UniMemo1); end; http://stackoverflow.com/questions/9771057/iterating-over-main-menus-items-including-subitems
  9. Hi altagur. Try function window.click(sender, eOpts) { MainForm.UniURLFrame1.iframe.src = "files/test.htm"; } or procedure TMainForm.UniButton1Click(Sender: TObject); begin UniSession.AddJS(UniURLFrame1.JSName + '.iframe.src = "files/test.htm";'); end;
  10. Hi apicito. Very interesting question! There is a solution for UniPanel. I think for UniGroupBox, also can use UniPanel, inside which will UniGroupBox ... Try ... add Events in UniPanel1 afterrender and blur: function afterrender(sender, eOpts) { Ext.FocusManager.enable(); var arr = []; arr.push(sender.id); sender.query().forEach(function (e) {if (e.inputEl) {arr.push(e.inputEl.id)} else {arr.push(e.id); arr.push(e.id + '-body');} }); sender.query().forEach(function (e) {e.on('blur', function (e) { setTimeout(function(){ if (Ext.get(document.activeElement).id) { for (var i = 0; i < arr.length; i++) { if (arr[i] === Ext.get(document.activeElement).id) { return false; } }; sender.fireEvent('blur', e); } }, 10); return false; } )}); } function blur(sender, the, eOpts) { if (sender.id == MainForm.UniPanel1.id) { var arr = []; arr.push(sender.id); sender.query().forEach(function (e) {if (e.inputEl) {arr.push(e.inputEl.id)} else {arr.push(e.id); arr.push(e.id + '-body');} }); setTimeout(function(){ if (Ext.get(document.activeElement).id) { for (var i = 0; i < arr.length; i++) { if (arr[i] === Ext.get(document.activeElement).id) { return false; } }; ajaxRequest(MainForm.UniPanel1, '_blur', ['param0=0']); } }, 10); return false; } else {ajaxRequest(MainForm.UniPanel1, '_blur', ['param0=0']);} } procedure TMainForm.UniPanel1AjaxEvent(Sender: TComponent; EventName: string; Params: TStrings); begin if EventName = '_blur' then begin //your custom logic ShowMessage('blur on Panel'); end; end; certainly can code needs to be optimized... Tested in FF and Chrome ... Sincerely
  11. Hi Michael Schindler. In brief I can say: 1. How do you find these kind of solutions?! - Well, on the Internet, in forums, using debuggers ... 2. TxPopupMenu(pmMasterTables).GetMenuControl.JSName - This trick provides access to protected methods of a class ... http://hallvards.blogspot.com/2004/05/hack-4-access-to-protected-methods.html 3. Should I post this into bug reports, because obviously "pmMastertables.Items.Clear;" is not working? - I do not know this is a bug or not implemented yet ... Sincerely ...
  12. Hi Michael Schindler. You are right. Solution: add the update() after items clear: procedure TMainForm.UniButton2Click(Sender: TObject); begin //Items.clear UniSession.AddJS(TxPopupMenu(pmMasterTables).GetMenuControl.JSName + '.items.clear();'); UniSession.AddJS(TxPopupMenu(pmMasterTables).GetMenuControl.JSName + '.update();'); //pmMastertables.Items.Clear; end; Best regards.
  13. Hi Michael Schindler. Try this: ... type TxPopupMenu = class(TuniPopupMenu) end; ... procedure TMainForm.UniButton1Click(Sender: TObject); begin //Items.clear uniSession.AddJS(TxPopupMenu(uniPopupMenu1).GetMenuControl.JSName + '.items.clear();'); end;
  14. Hi Michael Schindler. I think the problem here is precisely when combined date and time ... Individually working correctly ... I try to find a solution ...
  15. Hi Mohammad. Can you give a test case?
  16. Hi Michael Schindler. I have no problem using this code: ... if UniDBGrid1.Columns[i].Field.DataType in [ftDateTime] then begin UniSession.AddJS(UniDBGrid1.JSName + '.columnManager.columns[' + IntToStr(i) + '].setEditor(' + ' new Ext.form.field.Date({' + ' id: ''' + UniDBGrid1.JSName + 'columnsEditor' + IntToStr(i) + ''', ' + ' xtype: ''datefield'',' + ' format: ''d/m/Y'',' + ' anchor: ''100%'',' + ' maxValue: new Date()' + ' })' + ' );'); end ... Maybe you need to separately specify certain types of fields? for example: if Column.Field.DataType in [ftDate, ftTime, ftDateTime] then if Column.Field.DataType in [ftTime] then if UniDBGrid1.Columns[i].Field.DataType in [ftDate, ftDateTime] then begin UniSession.AddJS(UniDBGrid1.JSName + '.columnManager.columns[' + IntToStr(i) + '].setEditor(' + ' new Ext.form.field.Date({' + ' id: ''' + UniDBGrid1.JSName + 'columnsEditor' + IntToStr(i) + ''', ' + ' xtype: ''datefield'',' + ' format: ''d/m/Y'',' + ' anchor: ''100%'',' + ' maxValue: new Date()' + ' })' + ' );'); end else if UniDBGrid1.Columns[i].Field.DataType in [ftTime] then begin UniSession.AddJS(UniDBGrid1.JSName + '.columnManager.columns[' + IntToStr(i) + '].setEditor(' + ' new Ext.form.field.Time({' + ' id: ''' + UniDBGrid1.JSName + 'columnsEditor' + IntToStr(i) + ''', ' + ' format: ''H:i'',' + ' anchor: ''100%'',' + ' increment: 30,' + ' minValue: ''8:00'',' + ' maxValue: ''23:00''' + ' })' + ' );'); end; Best regards.
  17. Hi Michael Schindler. 1. You do not need to assign each time editor for columns! 2. You can after opening the DataSet, attach the editor like this: UniSession.AddJS(UniDBGrid1.JSName + '.columnManager.columns[8].setEditor(' + UniDateTimePicker1.JSName + ');'); 3. But, I think you can not assign for multiple columns one editor. 4. Or you can dynamically create the editor as follows: procedure TMainForm.UniButton1Click(Sender: TObject); var i: Integer; begin //After opening DataSet for i := 0 to UniDBGrid1.Columns.Count - 1 do begin if UniDBGrid1.Columns[i].Field.DataType in [ftDateTime] then begin UniSession.AddJS(UniDBGrid1.JSName + '.columnManager.columns[' + IntToStr(i) + '].setEditor(' + ' new Ext.form.field.Date({' + ' id: ''' + UniDBGrid1.JSName + 'columnsEditor' + IntToStr(i) + ''', ' + ' xtype: ''datefield'',' + ' format: ''d/m/Y'',' + ' anchor: ''100%'',' + ' maxValue: new Date()' + ' })' + ' );'); end else if UniDBGrid1.Columns[i].Field.DataType in [ftTime] then begin UniSession.AddJS(UniDBGrid1.JSName + '.columnManager.columns[' + IntToStr(i) + '].setEditor(' + ' new Ext.form.field.Time({' + ' id: ''' + UniDBGrid1.JSName + 'columnsEditor' + IntToStr(i) + ''', ' + ' format: ''H:i'',' + ' anchor: ''100%'',' + ' increment: 30,' + ' minValue: ''8:00'',' + ' maxValue: ''23:00''' + ' })' + ' );'); end; end; end; http://docs.sencha.com/extjs/3.4.0/#!/api/Ext.form.Field Sincerely.
  18. http://forums.unigui.com/index.php?/topic/3787-unipagecontrol-changing-tabsheet-order/&do=findComment&comment=18090
  19. Hi Michael Schindler. Try: uniDBGrid1 ExtEvents: function cellclick(sender, td, cellIndex, record, tr, rowIndex, e, eOpts) { ajaxRequest(this, 'cellclick', []); } procedure TMainForm.UniDBGrid1AjaxEvent(Sender: TComponent; EventName: string; Params: TStrings); begin if EventName = 'cellclick' then ShowMessage('cellclick'); end;
  20. Sherzod

    Clear StringGrid

    Hi codeb. If you need complete cleaning UniStringGrid, think can use store.reload (); for example: Try uses ... uniGUIApplication ... ; UniSession.AddJS(UniStringGrid1.JSName + '.store.reload();'); Best regards
  21. Hi Michael Schindler. One of the solutions (I think there are other solutions). 1. I think you can not use one component at a time for multiple columns (although it is possible, but will slow down, so that every time this component to assign a specific column... uniGridCellClick (Column: TUniDBGridColumn) not the best place). 2. When you change the runtime DataSet, you can use instead Column.Editor:= uniDateTimePicker1 this code: uses ... uniGUIApplication ... ; UniSession.AddJS(UniDBGrid1.JSName + '.columnManager.columns[8].setEditor(' + UniDateTimePicker1.JSName + ');'); 3. Or whenever changes DataSet, remove all controls on TUniHidenPanel, and re-create the controls and attach to the column ... //... re-created components in TUniHidenPanel UniSession.AddJS(UniDBGrid1.JSName + '.columnManager.columns[8].setEditor(' + UniDateTimePicker1.JSName + ');'); ... Try ... Sincerely.
  22. Hi memoferprof. Try uses ... UniGUIApplication ... ; procedure TMainForm.radioGroupClearCheckedClick(Sender: TObject); begin //radioGroupClearChecked UniSession.AddJS('if (Ext.get(' + UniRadioGroup1.JSName + '.items.getAt(0).getChecked()).elements[0]) {Ext.get(' + UniRadioGroup1.JSName + '.items.getAt(0).getChecked()).elements[0].setValue(false)};'); end; Best regards.
  23. Hi Román Attila. I think maybe it's not the best solution, but, gives the result ... In javascript: MainForm.CreateButton1.parentMenu.id; CreateButton1 - one of your UniMenuItem UniPopupMenu. For example: MainForm.CreateButton1.parentMenu.showAt(10, 10); Best regards
×
×
  • Create New...