CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

TIWTGJQComboBoxEx with data from querytable

by Corwin » 29 Apr 2015 12:31

HI

I want to use a TIWTGJQComboBoxEx to create a list to choose an item; I take the list from a TBOraQuery.
I connect everything but the combo I do not have any item.
In TIWTGJQComboBoxEx I insert the name of TBOraQuery in Datalink.DataSource and FiledName in the name of the field to display in the combo.
Something is missing?

Regards

P.S.
(if instead use a TIWCGDropDown, everything works)
Corwin
 
Posts: 114
Joined: 27 Apr 2015 10:01

by Jorge Sousa » 29 Apr 2015 14:07

Hello

You need to match the several ComboEx.Items[i].Value to the DataSet values, are you doing this?
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by Corwin » 29 Apr 2015 14:14

I did not think it was necessary ... there is an object combo that gets automatically (such as TIWCGDropDown)?

and if I have to enter the values manually of what I need datalink?

otherwise I have to do for the table and enter the individual items? as you insert the key and the description?
Corwin
 
Posts: 114
Joined: 27 Apr 2015 10:01

by Jorge Sousa » 29 Apr 2015 14:41

Hi

Yes, only DropDown has items filled by a dataset, because it has ajax loading controlled by a given number of records. We don't want to take the risk to fill the combos with a lot of records.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by Corwin » 29 Apr 2015 14:45

understand...

1) and if I have to enter the values manually of what I need datalink?

2) that is correct?
Code: Select all
  while not dm.TBOraSepe1.EOF  do
   begin  IWCGJQComboBoxExAzie.Items.AddOption(dm.TBOraSepe1.FieldByName('SEDE_DESCR').AsString,dm.TBOraSepe1.FieldByName('EL').AsString, True);
 dm.TBOraSepe1.Next;
  end;
Last edited by Corwin on 29 Apr 2015 14:54, edited 1 time in total.
Corwin
 
Posts: 114
Joined: 27 Apr 2015 10:01

by Jorge Sousa » 29 Apr 2015 14:53

Hi again

not quite correct

Value is the key

i would do this,

Code: Select all
var
  Item: TIWCGJQComboBoxExItem;
begin
  dm.TBOraSepe1.First;
  while not dm.TBOraSepe1.EOF do
  begin
    Item:= IWCGJQComboBoxExAzie.Items.Add;
    Item.Value := IntToStr(dm.TBOraSepe1.FieldByName('EL').AsInteger); // ????
    Item.Caption:= dm.TBOraSepe1.FieldByName('SEDE_DESCR').AsString; 
    dm.TBOraSepe1.Next;
  end;
end;


if this is called in an ajax (or async) event, you need to call aditionally

IWCGJQComboBoxExAzie.AjaxReRender
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by Corwin » 29 Apr 2015 15:10

Hi again, Jorge

actually works, thanks ...

but explain to me what is the datalink because I have to do things manually?

regards
Raul
Corwin
 
Posts: 114
Joined: 27 Apr 2015 10:01

by Jorge Sousa » 29 Apr 2015 15:48

Hello

In this case, the DataLink only selects the Item / Caption, for the currrent value.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by Corwin » 29 Apr 2015 15:53

ok ...

last question ..
how to control the selection in the combo box (then I do a query for a combo next connected)? old Delphi had onExit ...

Regards
Corwin
 
Posts: 114
Joined: 27 Apr 2015 10:01

by Jorge Sousa » 29 Apr 2015 16:06

You will find the suitable event in ComboBoxEx.JQComboBoxExOptions

http://www.cgdevtools.com/docs/_html/IWCGJQComboBox.TIWCGJQComboBoxExOptions.htm
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

Next

Return to JQComboBoxEx

cron

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.