Jump to content

Sherzod

Moderators
  • Posts

    19790
  • Joined

  • Last visited

  • Days Won

    643

Posts posted by Sherzod

  1. in runtime:

    uses ... UniGUIApplication ...
    procedure TMainForm.UniButton1Click(Sender: TObject);
    begin
      UniSession.AddJS(UniPageControl1.JSName + '.items.getAt(0).items.getAt(2).tab.hide();');
    end;

    Or

    runtime or desingtime:

     

    UniTabSheet1.TabVisible := False;

    UniTabSheet2.TabVisible := False;

     

    ....

  2. Solution:

     

    Hide:

    UniSession.AddJS(UniPageControl1.JSName + '.tabPanel.hide();');

     

    Show:

    UniSession.AddJS(UniPageControl1.JSName + '.tabPanel.show();');

     

    http://forums.unigui.com/index.php?/topic/2939-how-to-hide-header/&do=findComment&comment=17616

     

     

    or hide / show by index, example index=2

     

    Hide:

    UniSession.AddJS(UniPageControl1.JSName + '.items.getAt(0).items.getAt(2).tab.hide();');

     

    Show:

    UniSession.AddJS(UniPageControl1.JSName + '.items.getAt(0).items.getAt(2).tab.show();');

  3. Hi.

     

    Try this:

     

     

    UniPanel1 -> ClientEvents -> UniEvents add beforeInit
    function beforeInit(sender)
    {
      sender.layout = 'accordion';
      sender.items = [{
                title: 'Panel 1',
                html: 'Panel 1 content'
            }, {
                title: 'Panel 2',
                html: 'Panel 2 content'
            }, {
                title: 'Panel 3',
                html: 'Panel 3 content'
            }];
    }
  4. Hi codeb!

     
    Try this:
     
    UniDBGrid1 -> ClientEvents -> ExtEvents add reconfigure
    function reconfigure(sender, store, columns, oldStore, the, eOpts)
    {
      // columns[your_column_index]
      columns[0].width = 110;
      columns[0].renderer = function (v, m, r) { var id = Ext.id();Ext.defer(function () {Ext.widget('progressbar', { renderTo: id, value: v / 100, width: 100 });}, 50);return Ext.String.format('<div id="{0}"></div>', id);};
    }

    post-906-0-91468400-1388834250_thumb.png

     

    http://ext4all.com/post/progress-bar-inside-a-grid-cell

     
    Sincerely.
  5. Hi ganzqgy.
     
    Try this:
     

    in designtime:

     

    UniDateTimePicker1 - > ClientEvents - > UniEvents add beforeInit

    function beforeInit(sender)
    {
      sender.setMinValue(new Date(2013,0,1)); 
      sender.setMaxValue(new Date(2014,11,31));
    }

    or

     

    in runtime:

    UniSession.AddJS(UniDateTimePicker1.JSName + '.setMinValue(new Date(2012,0,1));');

    http://stackoverflow.com/questions/10241626/extjs-datefield-initialising-date

    http://stackoverflow.com/questions/1056728/where-can-i-find-documentation-on-formatting-a-date-in-javascript

     

     
    Sincerely.
    • Like 1
  6. Hi eelias.
     
    The width of the vertical scroll bar can be found so:
    'document.getElementById("'+UniDBGrid1.JSName+'_id").parentNode.offsetWidth - 
    document.getElementById("'+UniDBGrid1.JSName+'_id").offsetWidth;'
     

    I think you can always reduce to this value in the calculation, regardless of the visibility of scroll...

     

    or use grid.headerCt.forceFit = true;

     

    UniDBGrid1 - > ExtEvents - > reconfigure

    function reconfigure(sender, store, columns, oldStore, the, eOpts){
      sender.headerCt.forceFit=true;
    }

    Sorry if misunderstood the question.

     

     

    Sincerely.
    • Upvote 1
  7. Hi eelias.
     
    If I understand correctly, try this:
    procedure TMainForm.UniButton1Click(Sender: TObject);
    begin
      UniSession.AddJS(UniPanel1.JSName + '.animate({ duration: 1000, to: { x: 10, y: 10, opacity: 100}, listeners: {afteranimate: function() {ajaxRequest('+UniPanel1.JSName+', ''finished'', [])}}});');
    end;
    procedure TMainForm.UniPanel1AjaxEvent(Sender: TComponent; EventName: string;
      Params: TStrings);
    begin
      if EventName = 'finished' then begin
         // Your custom logic     
         ShowMessage('finished');
      end;
    end;
    Animation Events

    Each animation you create has events for beforeanimationafteranimate, and lastframe.
    Keyframed animations adds an additional keyframe event which fires for each keyframe in your animation.

    All animations support the listeners configuration to attact functions to these events.

    startAnimate: function() {
        var p1 = Ext.get('myElementId');
        p1.animate({
           duration: 100,
            to: {
                opacity: 0
            },
            listeners: {
                beforeanimate:  function() {
                    // Execute my custom method before the animation
                    this.myBeforeAnimateFn();
                },
                afteranimate: function() {
                    // Execute my custom method after the animation
                    this.myAfterAnimateFn();
                },
                scope: this
        });
    },
    myBeforeAnimateFn: function() {
      // My custom logic
    },
    myAfterAnimateFn: function() {
      // My custom logic
    }

    Due to the fact that animations run asynchronously, you can determine if an animation is currently running on any target by using the getActiveAnimationmethod. This method will return false if there are no active animations or return the currently running Ext.fx.Anim instance.

    In this example, we're going to wait for the current animation to finish, then stop any other queued animations before we fade our element's opacity to 0:

    var curAnim = p1.getActiveAnimation();
    if (curAnim) {
        curAnim.on('afteranimate', function() {
            p1.stopAnimation();
            p1.animate({
                to: {
                    opacity: 0
                }
            });
        });
    }

     

     
    Sincerely.
    • Upvote 1
  8. Hi eelias.

     

    Maybe not the best solution...

     

    If you created a form with
    UniPanel1.Visible := False,
    then
     
    1. Change the Visible property to true:
        UniPanel1.Visible = True;
     
    2. Then, add beforeInit to UniPanel1 -> UniEvents 
    function beforeInit(sender)
    {
      sender.animate({ duration: 1, to: { opacity: 0 }});
    }

    3. Then you can use your code.    

    UniSession.AddJS(UnPanelMessage.JSName + '.animate({ duration: 1000, to: { opacity: 1 });');
    UniSession.AddJS(UnPanelMessage.JSName + '.animate({ duration: 1000, to: { opacity: 0 });');
    Sincerely
     
    (Sorry if I misunderstood the question...)

     

  9. Hi Farshad.

     

    Please tell me whether it is possible disable synchronization of changes in the grid: 


    grid.store.autoSync = false;

    And then after the changes the user can save the changes.

    Using: 


    grid.store.sync ();

     

    Is it possible?

     

    Thank you.

  10. QUESTION: If i use the delphi intebase components .. where should i put the connection and the querys ?  have i a problem with new records again ?

     

     

    Hi erich.wanker.

     

     

    I use standard components InterBase.
    connection and the queries, it's desirable put in DataModule...
     
    Sincerely
  11. Hi All.

     

    Another interesting feature animation - pulse sets pulsation elements.

    element.frame("#0000b9", 5, {
        duration: 1000
    });

    Sample:

    UniSession.AddJS(UniButton1.JSName + '.el.frame("#0000b9", 3, {duration: 1000});');

    I think may be useful to draw attention to a particular element.

     

    post-906-0-87845200-1386330964_thumb.png

     

    Sincerely

    • Upvote 4
  12. In designtimes, uniStringGrid's FixedRows and FixedCols are the same as normal StringGrid.

    but in runtimes as webmode, all cells of the unistringgrid are the same, they can be edited with options property of "UniStringGrid -> Options -> goEditing = true", and all can not be edited with "goEditing = False".

    And now, I just want to make FixedRows and FixedCols Can not be edited, no matter "goediting" be true or false.

     

    I'm sorry for my poor description.

     

    Sorry I just didn't understand the question, now everything is clear.
    Now I will try to find a solution...
×
×
  • Create New...