Jump to content

UniComboBox.ItemIndex always equals 0


lxpbuaa

Recommended Posts

Hi,

I create a combobox at runtime, and insert into DBGird.pagingBar:

 FComboPageSize := TUniComboBox.Create(Self.Owner);
    FComboPageSize.Items.Add('每页25条');
    FComboPageSize.Items.Add('每页50条');
    FComboPageSize.Items.Add('每页100条');
    FComboPageSize.Items.Add('每页200条');
    FComboPageSize.Style := csDropDownList;
    FComboPageSize.ItemIndex := 0;
    FComboPageSize.OnChange := DoCombPageSizeChange;

procedure TdlzUniDBGrid.DoOnAfterLoad;
begin
  if WebOptions.Paged then
    JSInterface.JSCall('pagingBar.insert', [1, FComboPageSize.JSControl]);
  inherited;
end;

FComboPageSize.ItemIndex always equals 0, why, thanks!

procedure TdlzUniDBGrid.DoCombPageSizeChange(Sender: TObject);
begin
  if WebOptions.Paged then
    WebOptions.PageSize := Round(25 * Power(2, FComboPageSize.ItemIndex));
end;

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...