Jump to content

Sherzod

Moderators
  • Posts

    19706
  • Joined

  • Last visited

  • Days Won

    637

Posts posted by Sherzod

  1. instead, use this UniEvent

     

    function OnBeforeInit(Sender)

    {

        Ext.Apply(sender, { emptyText: 'text to display when the field is empty' });

    }

     

    Hi estrify.

    Thank you.

    With all due respect to you.

     

    Since I got error, I corrected your code.

     

    Sender to sender

    Apply to apply

     

    function OnBeforeInit(sender)
    {
      Ext.apply(sender, { emptyText: 'text to display when the field is empty' });
    }

    Sincerely.

  2. source is in place where in unidbgrid? helpme?Duser

     

    For example:

    ....
    uses uniGUIApplication, ....
    ....
    
    
    procedure TMainForm.UniButton1Click(Sender: TObject);
    var 
      newpageSize: String;
    begin  
      newpageSize := '3';
      UniSession.AddJS('MainForm.UniDBGrid2.getStore().pageSize = '+newpageSize+';');
      UniSession.AddJS('MainForm.UniDBGrid2.getStore().reload({params:{start:0, limit:'+newpageSize+'}});');
      UniSession.AddJS('MainForm.UniDBGrid2.getStore().loadPage(1);');
      UniSession.AddJS('MainForm.UniDBGrid2.getView().refresh();');
    end;

    Best regards

  3. Hi nim.

     

    Try this

    newpageSize := '3';
    UniSession.AddJS('MainForm.UniDBGrid2.getStore().pageSize = '+newpageSize+';');
    UniSession.AddJS('MainForm.UniDBGrid2.getStore().reload({params:{start:0, limit:'+newpageSize+'}});');
    UniSession.AddJS('MainForm.UniDBGrid2.getStore().loadPage(1);');
    UniSession.AddJS('MainForm.UniDBGrid2.getView().refresh();');
    

    Best regards

    • Upvote 1
  4. Hi Kanatshym.

     

    A solution using jquery:

    1. You need to download file jquery. Paste the file to folder (.....\files\), connect jquery (ServerModule -> CustomFiles -> add files/jquery-1.3.2.min.js)

    2. Add in the form UniHTMLFrame.

    3. In the OnCreate form add the following code:

    UniHTMLFrame1.HTML.Add ('<script>' +
                              '$(".x-grid-view").css("overflow-y", "hidden");' +
                              '$("#' + UniScrollBox1.JSName + '_id-body").scroll(function(){' +
                              '$(".x-grid-view").scrollTop($("#' + UniScrollBox1.JSName + '_id-body").scrollTop());})' +
                              '</script>');

    Used only one UniDBGrid.

     

    post-906-0-11552600-1369648283_thumb.pngpost-906-0-01448500-1369648304_thumb.png

     

    GridEditors2.zip

     

     

    Sincerely ...

  5. Hi patmap.

    Incorrect event handlers when inserting components (I tried it with components UniDateTimePicker, UniComboBox, UniXComboBox) in UniXPanel.

    Not working correctly event OnSelect, OnChange ... (Other events are not tested)

     

    UniXPanel version: 5.6.0

    XComponents: v5.9.2

     

    Embarcadero® Delphi® XE2 Version 16.0.4504.48759

    Windows 7 Ultimate

    UniGUI v0.93

    FF 21.0

     

     

    Sincerely.

  6. But now another problem appeared to do simultaneous skrolining unidbrid and scroll box.

     

    Hi Kanatshym.

     

    Sorry if I misunderstood the question.

     

    If you need scrolling to the grid can use the following code:

     

    UniButton1.ClientEvents.ExtEvents.Values ​​['OnClick'] := 'function OnClick (sender, e) {MainForm.UniDBGrid1.scrollByDeltaX (10); MainForm.UniDBGrid1.scrollByDeltaY (10);}';

    Best regards.

  7. Hi Kanatshym.

    To start such a decision. Maybe there are other solutions.
    Try this:

    Add the button to the form UniButton1.

    procedure TMainForm.UniFormCreate (Sender: TObject);
    begin
      UniButton1.ClientEvents.Enabled := True;
      UniButton1.ClientEvents.ExtEvents.Values ​​['OnClick'] := 'function OnClick (sender, e) {MainForm.UniScrollBox1.body.dom.scrollTop = 100; MainForm.UniScrollBox1.body.dom.scrollLeft = 100;}';
    end;
    
    procedure TMainForm.UniButton1Click (Sender: TObject);
    begin
      //
    end;

    Will Scroll the body down and right by 100 pixels.

     

    tested in FF.

     

    Best regards.
     

    • Upvote 1
  8. Hi Roberto.

    Try, can will help you...
     

    type
       TMyForm = class (TUniForm)
        ......
        ......
    procedure MyAjaxEvent (Sender: TComponent; EventName: string;
       Params: TStrings);
    
    
       ......
    
    TMyForm.MyAjaxEvent procedure (Sender: TComponent; EventName: string;
       Params: TStrings);
    begin
       if EventName = 'myAjaxEvent' then
       begin
         (Sender as TUniLabel). Width: = StrToInt (Params.Values ​​['Width']);
       end;
    end;
    
    
    procedure TMyForm.UniFormCreate (Sender: TObject);
    var
       oMyLabel: TUniLabel;
    
    begin
       oMyLabel := TUniLabel.Create (Self);
       with oMyLabel do begin
         Parent := Self;
         Name := 'XoMyLabel';
         OnAjaxEvent := MyAjaxEvent;
         oMyLabel.ClientEvents.Enabled := True;
         oMyLabel.ClientEvents.ExtEvents.Values ​​['onresize'] := 'function (sender, adjWidth, adjHeight, rawWidth, rawHeight) {ajaxRequest (MyForm.XoMyLabel,'' myAjaxEvent'', ['' Width ='' + adjWidth] )}';
         AutoSize := True;
         oMyLabel.Caption := 'Hi World!';
         Top := 10;
         Left := 10;
       end;
       // Right here to get the value of width can not succeed ...
    end;
    
    
    procedure TMyForm.UniButton1Click (Sender: TObject);
    begin
       ShowMessage (IntToStr ((Self.FindComponent ('XoMyLabel') as TUniLabel). Width));
    end;

    Sincerely

  9. Dear Farshad.

    With all due respect, I have a question for you.
    You yourself are using UniGui, in some your projects. If yes, can you give a link or can share the business logic of your projects (in general terms).
    Thank you very much.

    Sincerely duser.

     

  10. Numberedit  can only save numbers.

     

    Hi Farshad.

    I think it is difficult to say, what is it a bug, but it needs to be solved (maybe a property as Default Value) ...

     

    This nasty error comes out every time you use the Number Fields (when the value becomes empty), of course, when used DataSet controls: UniDBEdit, UniDBNumberEdit, UniDBGrid etc.

     

    Thanks...

  11. The code in Delphi:

     

    procedure TMainForm.UniDBEdit1KeyUp(Sender: TObject; var Key: Word;
      Shift: TShiftState);
      function ToMixCase(InString: String): String;
      var
        i: Integer;
      begin
        if InString = '' then Exit;
        Result := LowerCase(InString);
        Result[1] := UpCase(Result[1]);
        For i := 1 to Length(InString) - 1 do begin
          if (Result[i] = ' ') 
          //or (Result[i] = '''') 
          //or (Result[i] = '"')
          //or (Result[i] = '-') 
          //or (Result[i] = '.') 
          //or (Result[i] = '(') 
          Then
            Result[i + 1] := UpCase(Result[i + 1]);
        end;
      end;
    begin
      (Sender as TUniDBEdit).Text := ToMixCase((Sender as TUniDBEdit).Text)
    end;
    

    but this code does not work for unicode ...

    This code may not be optimal, but it is also one solution...

    http://www.esanu.name/delphi/Object%20Pascal/Strings/Capitalize%20the%20first%20letter%20of%20each%20word%20in%20a%20string.html

  12. Hi Peter.

    Try use CSS Text - text-transform.

    http://www.codertools.com/css_help_guide/css_text-transform.aspx

    http://www.w3schools.com/cssref/playit.asp?filename=playcss_text-transform&preval=capitalize

     

    Or


    Capitalize the first letter of all words in a string:

     

    function ucFirstAllWords( str )
    {
    var pieces = str.split(" ");
    for ( var i = 0; i < pieces.length; i++ )
    {
    var j = pieces[i].charAt(0).toUpperCase();
    pieces[i] = j + pieces[i].substr(1);
    }
    return pieces.join(" ");
    } 
    

    http://stackoverflow.com/questions/1026069/capitalize-the-first-letter-of-string-in-javascript

  13. Hi Farshad.

    Please help in solving this problem!

    1. Please open the project: ... \ Program Files \ FMSoft \ Framework \ uniGUI \ Demos \ GridHeaderMutipleLevelGrouping

    2. Insert a button on the form UniBitBtn1, in which the handler to write the code:

     

    procedure TMainForm.UniBitBtn1Click (Sender: TObject);
    begin
      ClientDataSet2.Close
    end;
     

     



    3. Edit any cell.

    4. Click on the button.

    Error!

    This error comes when it is multi-level header.

    Please give the solution!

    Thank you ...

     

    post-906-0-79618900-1366695735_thumb.png

    post-906-0-25137600-1366695746_thumb.png

×
×
  • Create New...