Jump to content

zhyhero

uniGUI Subscriber
  • Posts

    131
  • Joined

  • Last visited

  • Days Won

    5

Posts posted by zhyhero

  1. On 6/15/2019 at 9:09 PM, Hayri ASLAN said:

    Please consider in demo AligmentControl is "uniAlignmentClient"

     

    image.png.c96e275838d47459b76c12ec0a4bee9a.png

    Hi Hayri, can I control when to create the RowConrol ( or Container) for purpose ?

    something like 

    1. procedure TMainForm.UniDBGrid1RowExpand(Sender: TUniCustomDBGrid;const RowId: Integer; var RowControl: TControl; Container: TUniContainer);
    2. begin    
    3.     if someflag=true then
    4.     begin
    5.         RowControl:=TSomeUniControl.Create(Container);
    6.     end
    7.     else
    8.     begin
    9.         nothing Created;
    10.     end;
    11. end;

     

  2. I want to use another image(font awesome) to replace datetimepicker's trigger button's  defalut icon (or image),

    Any idea?

     

    ======UniServerModule.CustomCss=======

    .x-form-date-trigger{
      position:relative;
      background-image:url("../images/form/trigger-dot-bg.png") !important;
      background-repeat: repeat;
      display:table-cell;
      padding-top: 1px;
      line-height: 1.5;
      border: 1px double #C0C0C0 !important;
    }
    .x-form-date-trigger:before{
      font-family: FontAwesome; content: "\f073";color:navy;
    }

    .x-form-arrow-trigger{
      position:relative;
      background-image:url("../images/form/trigger-dot-bg.png") !important;
      background-repeat: repeat;
      display:table-cell;
      padding-top: 1px;
      line-height: 1.5;
      border: 1px double #C0C0C0 !important;
    }
    .x-form-arrow-trigger:before{
      font-family: FontAwesome; content: "\f063";color:navy;
    }

    • Like 1
  3. 18 minutes ago, Sherzod said:

    OK,

    You can try to use getClass config

    1. In DesignTime:

    YourActionColumnButton -> ImageIndex = -1

    2. UniDBGrid -> ClientEvents -> ExtEvents -> function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts):

    
    function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
    {
        dataColIndx = 0;
        actionColIndx = 6;
        actionItemsIndx = 0;
        
        columns[actionColIndx].items[actionItemsIndx].isActionDisabled = function (grid, rowIndex, colIndex, items, record) {
            return (record.data[dataColIndx] > 1500);
        };
        
        columns[actionColIndx].items[actionItemsIndx].getClass = function(value, metadata, record) {
            if (record.data[dataColIndx] > 1500) {
                return "x-fa fa-home"
            }
            else {
                return "x-fa fa-user"
            }
        };
    }

    ActionIconCls.png.1f570d676aeb6e1ed8cdc450d8f19a48.png

     

    Worked !

    ActionColumnButtons.png.05b108d937e797e63772cc7203dbb237.png

  4. 2 hours ago, Sherzod said:

    Can you try... ?

    
    procedure TMainForm.UniButton1Click(Sender: TObject);
    var
      ImgIndx,
      ActionColIndx,
      ActionItemIndx: Byte;
    begin
      ImgIndx := 1;
      ActionColIndx := 6;
      ActionItemIndx := 0;
    
      with UniDBGrid1 do
      begin
        JSInterface.JSAssign(
                'icon',
                [UniNativeImageList1.GetImagePngUrl(ImgIndx)],
                //[UniNativeImageList1.GetImageIconUrl(ImgIndx)],
                //[UniNativeImageList1.GetImageBitmapUrl(ImgIndx)],
                Columns[ActionColIndx].ActionColumn.Buttons.Items[ActionItemIndx].JSMenuItem
        );
        JSInterface.JSCall('view.refresh', []);
      end;
    
    end;

     

    Sorry, I didn't  say it clearly.

    My question should look like this image.

    ActionColumnButtonsIconCls.png.e324fc90236f8e59be03007c72020845.png

  5. 1 hour ago, Sherzod said:

    Hi,

    Can you try to use this approach for now?

    UniDBGrid -> ClientEvents -> ExtEvents -> function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts):

    
    function reconfigure(sender, store, columns, oldStore, oldColumns, eOpts)
    {
        dataColIndx = 0;
        actionColIndx = 6;
        actionItemsIndx = 0;
        
        columns[actionColIndx].items[actionItemsIndx].isActionDisabled = function (grid, rowIndex, colIndex, items, record) {
            return (record.data[dataColIndx] > 1500);
        }
    }

     

    Thank you ,Sherzod !

    It's worked.

    ActionColumnButtonsEnableDisable.png.5ec9deff5815d5537724b72e98b7eaf3.png

  6. I replace FDMemTable to ClientDataSet, and get same effect.

    With style =csDropDown ,

    record.no=24, Data( 2,3,6,12,24 )  trans to Lv1(2),Lv2(3),Lv3(6),Lv4(12),Lv5(24) 

    when record.no=25,Data( 2,3,7,13,25 )  trans to Lv1(2),Lv2(3),Lv3(6),Lv4(12),Lv5(24)  , something happened.

       

  7. At first ,I don't know how to explain this accurately (or  exactly ) .

     

    I use five  UniDBLookupComboBoxs  as  'level'  selectors , and link datasources to their 'linksource' property(with 'ListFiled' and 'Keyfield').

    And Set 'MasterSource','MasterFields','IndexFieldNames' with FDMemTables (Is this called data  'cascade connection' ? ).

    The UniDBGrid Show some data with level infomation.

    Three  FDMemTables (lv1-lv5) groups have same data.

     

    So if i click one row on the UniDBGrid,  these Unidblookupcomboboxs will show  level infomations according to  currunt row's data(Id,id id....) of unidbgrid.

     

    And then get some  confusing  things.

    First, with some row data (id,id,id....),unidblookupcombobox show nothing (with style csDropDownList and csSimple).

    Second, 'Keyvalue:=xxx'  pass wrong data to  dataset ,not every time.

           (This is my wrong with data record 25 ,correct it )

    Third, each Unidblookupcombobox's style( I test csDropDown,csDropDownList and csSimple)  get diffrent effect .

     

    At end ,i hope someone may know what I say.........

     

    unidblucbb.thumb.png.78341b357e0bab41a5a089c90b404a6a.png

     

    Here is s testcase.

     

    testcase reupload here

    aDemo.rar

     

     

     

     

×
×
  • Create New...