Jump to content

Gabriel

uniGUI Subscriber
  • Posts

    66
  • Joined

  • Last visited

Posts posted by Gabriel

  1. I've changed a little bit the test case...

     

    What I was trying to accomplish is to hide all elements from the menu, it should be pretty straight forward, but, I think I found that the menu is not refreshing after setting the property. I add this function to the KeyUp event

     

    function keyup(sender,e,eOpts){
    	var me = MainForm.UniTreeMenu1;
    	var almc = me.store;
    	var vItemGlobal = '';
    	console.log('----Start----');
    	for(var i=0; i< almc.data.items.length;i++){
    		var vItem = almc.data.items[i].get('text');
    		vItemGlobal = vItemGlobal + '-' + vItem;
    	}
    	
    	console.log('Hide elements');
    	for(var i=0; i< almc.data.items.length;i++){
    		almc.data.items[i].set('visible',false);
    	}
    	console.log('After hide');
    	for(var i=0; i< almc.data.items.length;i++){
    		console.log(almc.data.items[i].get('text'));
    		if(almc.data.items[i].get('visible')){
    			console.log(' - - - Is visible');
    		}
    	}
    	
    	console.log('List: ' +vItemGlobal);
    	console.log('----End----');
    	
    }

    And the result was this (console log)

     

    js.js:5 ----Start----
    js.js:11 Hide elements
    js.js:15 After hide
    js.js:17 Item two
    js.js:19  - - - Is visible
    js.js:17 Item four
    js.js:19  - - - Is visible
    js.js:17 Empleados
    js.js:19  - - - Is visible
    js.js:17 Metodos y Reportes
    js.js:19  - - - Is visible
    js.js:17 Informes de Gestión
    js.js:19  - - - Is visible
    js.js:23 List: -Item one-Item two-Item tree-Item four-Empresa-Empleados-Plan Vacacional-Metodos y Reportes-Autogestión-Informes de Gestión
    js.js:24 ----End----
     //second run
    undefined
    js.js:5 ----Start----
    js.js:11 Hide elements
    js.js:15 After hide
    js.js:17 Item four
    js.js:19  - - - Is visible
    js.js:17 Metodos y Reportes
    js.js:19  - - - Is visible
    js.js:23 List: -Item two-Item four-Empleados-Metodos y Reportes-Informes de Gestión
    js.js:24 ----End----
    //third
    undefined
    js.js:5 ----Start----
    js.js:11 Hide elements
    js.js:15 After hide
    js.js:17 Metodos y Reportes
    js.js:19  - - - Is visible
    js.js:23 List: -Item four-Metodos y Reportes
    js.js:24 ----End----
    //fourth
    undefined
    js.js:5 ----Start----
    js.js:11 Hide elements
    js.js:15 After hide
    js.js:23 List: -Metodos y Reportes
    js.js:24 ----End----

    The menu is still the same

     

    blob.png.fc29323d24d5306e1d1ec84409eabaa2.png

     

    I attach the updated project. The javascript code is in the Release/files folder 

     

    Regards

    UniTestMenu.rar

  2. Hi.

     

    I have a problem filtering the UniTreeMenu. I've adapted this method from Extjs

     

     filterStore: function(value) {
                    var me = this,
                        store = me.store,
                        searchString = value.toLowerCase(),
                        filterFn = function(node) {
                            var children = node.childNodes,
                                len = children && children.length,
                                visible = v.test(node.get('text')),
                                i;
    
                            // If the current node does NOT match the search condition
                            // specified by the user...
                            if (!visible) {
    
                                // Check to see if any of the child nodes of this node
                                // match the search condition.  If they do then we will
                                // mark the current node as visible as well.
                                for (i = 0; i < len; i++) {
                                    if (children[i].isLeaf()) {
                                        visible = children[i].get('visible');
                                    } else {
                                        visible = filterFn(children[i]);
                                    }
                                    if (visible) {
                                        break;
                                    }
                                }
    
                            } else { // Current node matches the search condition...
    
                                // Force all of its child nodes to be visible as well so
                                // that the user is able to select an example to display.
                                for (i = 0; i < len; i++) {
                                    children[i].set('visible', true);
                                }
    
                            }
    
                            return visible;
                        },
                        v;
    
                    if (searchString.length < 1) {
                        store.clearFilter();
                    } else {
                        v = new RegExp(searchString, 'i');
                        store.getFilters().replaceAll({
                            filterFn: filterFn
                        });
                    }

    look like this

     

    blob.png.96ccba196abd013e8baba6b341d43629.png

    The code was working great, until a uniGUI update, i believe it was 1498 wich introduce Ext js 6.7 (not sure). Since that update the code isn't working anymore, it does not filter the tree and furthermore, is not expanding all the tree nodes. Anyone knows anything about this? 

    I cant use the filter as is it show on the demo files, because my tree is dynamically created. (related post: 

     

    Regards

  3. Hello, 

    I attach the project (sample project)

     

    4 minutes ago, Sherzod said:

    How?

    By enabling the following options:

    blob.png.2843543dda655ea4b9c7d5ef6378c831.png

     

    2 minutes ago, Sherzod said:

      In the same application ?

    Yes, but on different screens. In the sample project, there are two grids. I want to copy something from the one on top to the one on the bottom.

     

    8 minutes ago, Sherzod said:

    Hello,

    Can you explain in more details once again ?

    Of course, sorry if I'm not being clear. Basically, the idea is copy information (the content of every cell) from one grid to another using CTRL + C, CTRL + V, both grids are exactly the same, the number of columns, properties, etc.

     

    Regards

     

    Gabriel

     

     

     

    TestUniStringGrid2.zip

  4. Hello, 

    It is posible with a UniStringGrid to select several rows (2 cols max) , copy and paste them in another grid?

    I was searching and i find the option to select multiple rows, and multiple cols. But It was not posible to copy the content. What i'm try to achieve is the same behaviour that is posible with an xls document.

     

    Regards

     

  5. Hi, 

    I'm having an issue with the unistringgrid. I'll try to explain.

    I'm using a UniStringGrid so the user can enter some data (as detailed here http://forums.unigui.com/index.php?/topic/11309-solved-unistringgrid-editorview), which works great, but i'm having trouble saving the information to a text file, the problem is that the grid trims the blank spaces at the beginning of the cell but only when i add them myself.

     

    Some images:

    When i load the app and press the button show text:

     

    blob.png.bf41fb34b159d1eead4f628de495a492.png

     

    I edit the first cell adding a lot more blank space at the beggining and then click on Show Text

    blob.png.f95bd21eae7139b1cd9f0994a7845127.png

    The text has been trimed.

     

    I attach a test project. 

     

    It would be great if someone can help me.

     

    Regards

     

    UniStringGrid.zip

  6. Hi.

    Sure!. I attach the sample aplication. As you will see there is a small UniStringGrid in the project

     

    blob.png.9ad695f341d3899de5ab0ac73b2de1fc.png

     

    On the creation event, i set the values:

     

    procedure TMainForm.UniFormCreate(Sender: TObject);
    begin
      UniStringGrid1.Cells[0,1] := 'This Cell has no spaces';
      UniStringGrid1.Cells[0,2] := 'This                          Cell                           has                   a                         lot                          of                           spaces';
    end;
    

     

    As i said, i didnt find a way to show the spaces on the cell (0,2).

     

    But if you edit the cell the spaces are shown correctly.

     

     

    Let me know if you need anything else.

    The same issue happen if i edit the fields manually.

    Regards

     

     

    blob.png

    UniStringGrid.zip

  7. Hi, 

    I have an issue with the UniStringGrid. The problem is with the visualization and the edition of the information. The visualization is like html, but the edition es plain text. Is there a way to work always with plain text?

    This is how the information is viewed:

    blob.png.8a74dd5bd4d1fbd5b1a5c847d915d9a0.png

    If I edit the field 

    blob.png.ed94608e834536498782bc4521f1a2f3.png

    There is a lot of white space (that is correct). 

    The only way to replicate the white space is adding &nbsp;, but of course that the end user will not use that. So, basically what i am asking is if there is a way to change the view of the UniStringGrid to show the white spaces.

     

    Regards

     

     

     

  8. Hi,

     

    As an approximate solution for now :)

    procedure TMainForm.UniButton1Click(Sender: TObject);
    var
      I: Integer;
      _llist: string;
    begin
      with UniTreeMenu1 do
      begin
        SourceMenu.Items[0].Visible := False;
    
        _llist := '';
        for I := 0 to SourceMenu.Items.Count-1 do
          if not SourceMenu.Items[I].Visible then
            if _llist='' then _llist := '"'+SourceMenu.Items[I].Caption+'"'
            else _llist := _llist + ',"' + SourceMenu.Items[I].Caption+'"';
    
        if _llist<>'' then
        begin
          JSInterface.JSCall('getStore().clearFilter', []);
          JSInterface.JSCode(#1'.getStore().filterBy(function (record){ if (['+ _llist +'].indexOf(record.get("text"))>-1) return false; else return true;});');
        end
        else 
          JSInterface.JSCall('getStore().clearFilter', []);
      end;
    end;

    Best regards,

     

     

    Great.

     

    It only works when you are using TUniMenuItems as a SourceMenu? I'm creating the content of the menu at runtime and I can't make it work,

  9. Farshad,

    this issue was fixed, but now I have others:

     

    I'm trying to replace TuniTreeView with TuniTreeMenu in the demo "AllFeaturesDemo"

     

    1.- UniTreeMenu1.Items.Clear() does not work, throws the following ajax error: "Cannot set property 'lastOptions' of undefined"

     

    vUniTreeNode := UniTreeMenu1.Items.AddChild(nil, 'Text');

     

    2.- vUniTreeNode .Visible := true does not work, it does not do anything.

    3.- vUniTreeNode .Expanded := aExpand does not work, throws the following ajax error: "Cannot set property 'getNodeById' of undefined".

    4.- vUniTreeNode.ImageIndex := 1 does not work, throws the following a ajax error.

     

    Regards,

     

     

    Same issue even with the last version of Unigui

  10. Can you please post these requests to Support Portal.

     

    That said, TreeMenu is a very simple component. We will improve it constantly. However, it can never be as functional as a TreeView.

    We are posting the request. 

     

    Thank You

  11. For what purpose do you want to use it?

     

    We are developing an application where we have a menu of about 90 items (nodes and sub nodes and sub sub nodes). We are currently using a UniTreeView with the OnDblClick event to ensure the access to the correct form (due the fact that we have dataset of over 1M records - payroll)  

     

    I'm afraid that without that event our clients might open the incorrect form. Thats all.

  12. Hi, 

     

    I'm testing the UniTreeMenu (replacing UniTreeView with UniTreeMenu) and i found some issues.

     

    1.- There is no method FullExpand or FullCollapse

    2.- There is no events OnLoaded or OnDblClick

    3.- I was trying to make a SearchTree (like UniTreeView) and it fails

    4.- The procedure UniTreeMenu.Items.Clear fail.

     

    Both items 3 and 4 shows an Ajax Error "Cannot set property 'lastOptions' of undefined", but the UniTreeMenu.Items.Clear fails from time to time.

     

    Also, has anyone been able to set the font size? how?

     

     

    Has anyone have a similar experience?

     

     

     

    I'm using the last release

     

    Regards 

     

    Gabriel

×
×
  • Create New...