Jump to content

delagoutte

uniGUI Subscriber
  • Posts

    568
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by delagoutte

  1. Hello, i must implement a function that must work on a selected text in a memo. for exemple if i have this in a unimemo 1 - Montext1 2 - Montext1 3 - Montext1 i select the text "Montext1" of the second line, i call a function that replace number from a string by @ result : 1 - Montext1 2 - Montext@ 3 - Montext1 how can i do a thing like this (the function that change the selected text must be in seerver side )?
  2. interesting approach🙃 it works. thanks a lot
  3. You could find a test case with the problem (line 165 of main.pas) in source code i add - old method AddFunctionToGrid that works but override all grid not only specified grid -new code AddFunctionToGridV2 that should not override all grid but only the specified grid but sort no longer works GridColumnSort.zip
  4. no error but... the sort no longer works. i try do a test case
  5. the error comes from this line : this.callParent(arguments);'+#13#10+ no idea without test case ?
  6. i try with is if AddCancelSort then begin aGrid.ClientEvents.ExtEvents.Values['reconfigure']:= aGrid.ClientEvents.ExtEvents.Values['reconfigure']+ ' for (let i = 0; i<columns.length;i++){ '+ ' columns[i].sort= function(a) {'+#13#10+ ' var me = this;'+#13#10+ ' var grid = me.up(''tablepanel'');'+#13#10+ ' var ds = grid.store;'+#13#10+ ''+#13#10+ ' if (a==null && this.el.hasCls(''x-column-header-sort-DESC'')) {'+#13#10+ ' var removeIndx = -1;'+#13#10+ ' var activeIndx = me.getSortParam();'+#13#10+ ' var i = 0;'+#13#10+ ' var sortersCount = ds.sorters.items.length;'+#13#10+ ' ds.sorters.items.forEach(function(s) {'+#13#10+ ' if (s._property === activeIndx) {'+#13#10+ ' removeIndx = i;'+#13#10+ ' //return false;'+#13#10+ ' };'+#13#10+ ' i++;'+#13#10+ ' });'+#13#10+ ''+#13#10+ ' if (removeIndx != -1) {'+#13#10+ ' ds.sorters.removeAt(removeIndx);'+#13#10+ ' if (sortersCount > 1) {'+#13#10+ ' ds.load();'+#13#10+ ' } else {'+#13#10+ ' ajaxRequest(grid, ''sortClearAll'', []);'+#13#10+ ' ds.load();'+#13#10+ ' };'+#13#10+ ''+#13#10+ ' grid.headerCt.setSortState();'+#13#10+ ' };'+#13#10+ ' } else {'+#13#10+ ' this.callParent(arguments);'+#13#10+ ' };'+#13#10+ ' grid.setSortNumbers();'+#13#10+ ' }'+#13#10+ '}'+#13#10; end; but with this when i click on clumn header i have this error in console Uncaught TypeError: can't access property "apply", b is undefined callParent ExtJS sort http://localhost:8079/:1755 ExtJS 26 afterRender http://localhost:8079/uni-1.90.0.1564/ext-unicommon-min.js:9 ExtJS 4 constructor http://localhost:8079/uni-1.90.0.1564/ext-unicommon-min.js:9 ExtJS 25 hav you got an idea of the reason for this error ?
  7. Hello, i need expert extjs By default unigui gridcolumn sort have only 2 state when we click on column title : ascending, descending. i needed 3 state : ascending, descending; none for this i use this code to add this feature to a grid : if AddCancelSort then begin aGrid.ClientEvents.ExtEvents.Values['viewready'] := aGrid.ClientEvents.ExtEvents.Values['viewready']+ ''+#13#10+ ' me.getColumnIndex = function(grid, dataIndex, delta) {'+#13#10+ ' gridColumns = grid.headerCt.getGridColumns();'+#13#10+ ' for (var i = 0 + delta; i < gridColumns.length; i++) {'+#13#10+ ' if (gridColumns[i].dataIndex == dataIndex) {'+#13#10+ ' return i;'+#13#10+ ' }'+#13#10+ ' }'+#13#10+ ' };'+#13#10+ ' '+#13#10+ ' me.findColumnIndex = function(columns, dataIndex) {'+#13#10+ ' var index;'+#13#10+ ' for (index = 0; index < columns.length; ++index) {'+#13#10+ ' if (columns[index].dataIndex == dataIndex) {'+#13#10+ ' break;'+#13#10+ ' }'+#13#10+ ' }'+#13#10+ ' return index == columns.length ? -1 : index;'+#13#10+ ' };'+#13#10+ ''+#13#10+ ' me.setSortNumbers = function() {'+#13#10+ {$IFDEF DEBUG} ' console.log("'+agrid.Name+'-setSortNumbers"); '+#13#10+ {$ENDIF} ' var sCount = me.store.sorters.getCount();'+#13#10+ ''+#13#10+ ' me.el.select(''small.sortnumber'').elements.forEach(function(el) {'+#13#10+ ' $(el).remove()'+#13#10+ ' });'+#13#10+ ''+#13#10+ ' me.store.sorters.items.forEach(function(s) {'+#13#10+ ' var indx, col;'+#13#10+ ' indx = me.getColumnIndex(me, parseInt(s._property), parseInt(delta));'+#13#10+ ''+#13#10+ ' if ( me.columnManager.columns != null){'+#13#10+ ' var col = me.columnManager.columns[indx];'+#13#10+ ' if (col) col.el.select(''.x-column-header-text'').elements[0].innerHTML += ''<small class="sortnumber"> ('' + sCount + '')</small>'';'+#13#10+ ' sCount--;'+#13#10+ ' }'+#13#10+ ' });'+#13#10+ ' };'+#13#10+ ''+#13#10+ ' me.resetSort = function() {'+#13#10+ ' var activeIndx = currentHeaders.activeHeader.dataIndex;'+#13#10+ ' var i = 0;'+#13#10+ ' var sortersCount = me.store.sorters.items.length;'+#13#10+ ' me.store.sorters.items.forEach(function(s) {'+#13#10+ ' if (s._property === activeIndx) {'+#13#10+ ' removeIndx = i;'+#13#10+ ' return false;'+#13#10+ ' };'+#13#10+ ' i++;'+#13#10+ ' });'+#13#10+ ''+#13#10+ ' if (removeIndx != -1) {'+#13#10+ ' me.store.sorters.removeAt(removeIndx);'+#13#10+ ' if (sortersCount > 1) {'+#13#10+ ' me.store.load();'+#13#10+ ' } else {'+#13#10+ ' ajaxRequest(me, ''sortClearAll'', []);'+#13#10+ ' me.store.load();'+#13#10+ ' };'+#13#10+ ''+#13#10+ ' me.headerCt.setSortState();'+#13#10+ ' me.setSortNumbers();'+#13#10+ ' };'+#13#10+ ' };'+#13#10+ ''+#13#10+ ' Ext.override(Ext.grid.column.Column, {'+#13#10+ ' sort: function(a) {'+#13#10+ ' var me = this;'+#13#10+ ' var grid = me.up(''tablepanel'');'+#13#10+ ' var ds = grid.store;'+#13#10+ ''+#13#10+ ' if (a==null && this.el.hasCls(''x-column-header-sort-DESC'')) {'+#13#10+ ' var removeIndx = -1;'+#13#10+ ' var activeIndx = me.getSortParam();'+#13#10+ ' var i = 0;'+#13#10+ ' var sortersCount = ds.sorters.items.length;'+#13#10+ ' ds.sorters.items.forEach(function(s) {'+#13#10+ ' if (s._property === activeIndx) {'+#13#10+ ' removeIndx = i;'+#13#10+ ' //return false;'+#13#10+ ' };'+#13#10+ ' i++;'+#13#10+ ' });'+#13#10+ ''+#13#10+ ' if (removeIndx != -1) {'+#13#10+ ' ds.sorters.removeAt(removeIndx);'+#13#10+ ' if (sortersCount > 1) {'+#13#10+ ' ds.load();'+#13#10+ ' } else {'+#13#10+ ' ajaxRequest(grid, ''sortClearAll'', []);'+#13#10+ ' ds.load();'+#13#10+ ' };'+#13#10+ ''+#13#10+ ' grid.headerCt.setSortState();'+#13#10+ ' };'+#13#10+ ' } else {'+#13#10+ ' this.callParent(arguments);'+#13#10+ ' };'+#13#10+ ' grid.setSortNumbers();'+#13#10+ ' }'+#13#10+ ' });'#13#10; end; this code works fine since many years but i just realize there is a failure in my code. in the end of this code i use Ext.override(Ext.grid.column.Column, {'+#13#10+..... but with this code i override all grids in my app and not only the grid that i want add the feature. how can i rewrite this part of code for not using Ext.override(Ext.grid.column.Column, {.... and apply only for the designated grid ?
  8. @Sherzodyou are always on top 😄 thanks again
  9. @Hayri ASLAN have you yet work on integration of unisptoggle ? if yes , where can i fond the source code
  10. hello, i would like this toggle look like this : but i dont find the css class that i must use for having this result. any css champion could help me ?
  11. @Hayri ASLAN ithink i found the solution in the property : i use this : if aObject.ClassName = 'TJSMenuItem' then begin OurComponent:= TJSMenuItem(aObject).AttachedMenuItem; end else begin OurComponent:= TExtObject(aObject).AttachedComponent; if OurComponent is TUniMenuControl then OurComponent:= TUniMenuControl(OurComponent).AttachedComponent; end;
  12. @Hayri ASLAN i come back on this topic because it seems that you dont make th change. or maybe i don't understand how can i have the item that is clicked in a menu ?
  13. check your firewall, and if necessary add the hyper server process in process authorized or authorize the range port 16384 to 16384 +8
  14. for communication between iframe and his "parent"we used https://developer.mozilla.org/fr/docs/Web/API/Window/postMessage
  15. it seems i finish to find a solution for my problem i use this : procedure HighligthTabSheet(aTest : Boolean; var aUniTabSheet : TUniTabSheet); var C : TComponent; begin C := FindComponentUni(aUniTabSheet.Name); if aTest then begin if C <> nil then begin UniSession.AddJS(PCMain.Pages[seTsAdd.Value].JSName+'.tab.addCls(''TabNew'')'); UniSession.AddJS(PCMain.Pages[seTsAdd.Value].JSName+'.tab.addOverCls(''TabNew'')'); end end else begin if C <> nil then begin UniSession.AddJS(PCMain.Pages[seTsAdd.Value].JSName+'.tab.removeCls(''TabNew'')'); UniSession.AddJS(PCMain.Pages[seTsAdd.Value].JSName+'.tab.removeOverCls(''TabNew'')'); end end; end;
  16. sorry this plugin exist in extjs but it is bugged so with the same name there may be a conflict. so i rename the plugin use this version of fileplugin_tabscrollermenu.zip and use function tabPanel.beforeInit(sender, config) { sender.plugins = [ 'tabscrollermenu_w']; }
  17. @Sherzod I hope it will be clearer with this recording as you can see, i add class on some tabsheet but when the mouse over the title tabsheet the class is remove and lost. i would like the class stay assigned to the tabsheet.
  18. @Sherzoddo you see the problem with my sample project ?
  19. hello, i look that and //big rectangle chere the mask is applied .x-mask{ opacity: 0.5; background: rgb(255, 0, 0) none repeat scroll 0% 0%; } //rectangle around screen mask message .x-mask-msg{ opacity: 0.5; background: rgb(0, 255, 0) none repeat scroll 0% 0%; } //interior of screenmask message .x-mask-msg-inner{ opacity: 0.5; background: rgb(255, 0, 0) none repeat scroll 0% 0%; } //part text of screen mask .-x-mask-msg-text{ opacity: 0.5; background: rgb(0, 0, 255) none repeat scroll 0% 0%; } in your case i think you must modified the .x-mask-msg-inner
  20. Hello, i test your class and it is ok is it this red part in my screenshot that you would change ? or the background of 'Hello'
  21. i found a solution and i create a topic for this
  22. Hello, i share with you a method for adding a scroller menu for unipage control download the join file plugin_tabscrollermenu.zip uncompress in a directory where you have your application. for me it is in assets/plugin in unimainmodule register the js file and css file of the plugin uses .... uniGUIClasses,uniguitypes; .... initialization RegisterMainModuleClass(TUniMainModule); UniAddCSSLibrary('assets/plugin/TabScrollerMenu.css', False, [upoPlatformDesktop]); UniAddJSLibrary('assets/plugin/TabScrollerMenu.js', False, [upoPlatformDesktop]); in your unipagecontrol->unievents->Ext.tab.Panel[TabPanel] add : function tabPanel.beforeInit(sender, config) { sender.plugins = [ 'tabscrollermenu']; } note : if the property of a unitabsheet tabvisible = false then the tabsheet will not be in the menu
  23. inspect network tab in developper tools in firefox/chrome you probably have a 404 error for a css file
  24. sorry , i used firefox style editor to change font size for test. if use class in unigui there is not problem
×
×
  • Create New...