Jump to content

DbGrid Pagingbar New ComboBox - Clear/Load/Read - How ?


andyhill

Recommended Posts

I have added a new ComboBox to a DbGrid PagingBar and I want to in code at runtime to be able to:-

1) Clear ComboBox Items
2) Add Multiple ComboBox New Items
3) Read Selected item in Items(ComboBox) via AjaxEvent (_PurchaserItems_)

The problem is referencing and adjusting the ComboBox ?

My code fragments:-

...

      '    {'#13#10 +
      '      xtype: '#39'tbseparator'#39#13#10 +
      '    },'#13#10 +
      '    {'#13#10 +
      '      xtype: '#39'combobox'#39','#13#10 +
      '      name: '#39'Items'#39','#13#10 + // guess, compiles, no crash
      '      width: 300,'#13#10 +
      '      height: 24,'#13#10 +
      '      tooltip: '#39'Items'#39','#13#10 +
      '      handler: function() '#13#10 +
      '      {'#13#10 +
      '        ajaxRequest(sender, '#39'_PurchaserItems_'#39', []); '#13#10 +
      '      }  '#13#10 +
      '    },'#13#10 +
      '    {'#13#10 +
      '      xtype: '#39'tbseparator'#39#13#10 +
      '    },'#13#10 +


...

procedure TfInvoice.dbGridInvoiceAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings);
begin

  //////////////////////////////////////////////////////////////////////////////
  if EventName = '_PurchaserItems_' then begin 
    // Do My Thing
  end;

...

Thanks in advance

Link to comment
Share on other sites

3 hours ago, andyhill said:

I have added a new ComboBox to a DbGrid PagingBar and I want to in code at runtime to be able to:-

1) Clear ComboBox Items
2) Add Multiple ComboBox New Items
3) Read Selected item in Items(ComboBox) via AjaxEvent (_PurchaserItems_)

The problem is referencing and adjusting the ComboBox ?

Hi,

Sorry, can you please explain in more details what you wanted!?

And what problems are you facing?

Link to comment
Share on other sites

I need to re populate xtype: combobox "Items" outside of pagingbar javascript based on other ajax events.

Event A
"Items".Clear;
"Items".Add
"Items".Add
"Items".Add

Event B
"Items".Clear;
"Items".Add
"Items".Add
"Items".Add

Event C
"Items".Clear;
"Items".Add
"Items".Add
"Items".Add

Event D
I need to read selected item via ajax event (s:= dbGridInvoice.JSInterface.JSCall('pagingBar.getComponent("Items").getValue', [False]);) or something like that.

 

Link to comment
Share on other sites

  • 1 month later...

I have also added a control to the paging bar via PagingBarAuxControl  but would like the control to be closer to the other navigation buttons.

Is there any way to left align the control so it next to the very last control in the bar?

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...