|
Anthony
|
 |
« on: June 22, 2011, 12:21:19 PM » |
|
Hi everyone I am new to visualJS so do forgive me if this is a basic request, I have a vb6 application that I am now looking to convert to visualJS. I'll get right to the point. In my vb6 app i use combo dropdown list to display a list of patients, the list size can be anything from 1500 to 6700, now in vb6 the list is alphabet and the user only has to type a few letters and the list is filtered to the name,
basically how can I implement this filtered combo dropdown list box
Many Thanks in advanced.
ps what a great project.
|
|
|
|
|
Logged
|
|
|
|
|
sedrok (jslinb.ru)
|
 |
« Reply #1 on: June 22, 2011, 11:07:47 PM » |
|
jslinb listbox can be 300-400 entries. so you must use like this combination:  php code
|
|
|
|
« Last Edit: June 22, 2011, 11:10:44 PM by sedrok (jslinb.ru) »
|
Logged
|
|
|
|
|
Anthony
|
 |
« Reply #2 on: June 23, 2011, 02:11:22 AM » |
|
Many Thanks
I will try this out.
Anthony
|
|
|
|
|
Logged
|
|
|
|
|
Anthony
|
 |
« Reply #3 on: June 23, 2011, 10:04:33 AM » |
|
sedrok Thanks
I am getting the following error
"Uncaught Reference Error: SPA is not defined"
However when I type SPA. the code intellisense list of attributes and methods does appear. what am I missing. Also should I be using linb.Ajax or linb.request.
once again
Thank you
Anthony
|
|
|
|
|
Logged
|
|
|
|
|
sedrok (jslinb.ru)
|
 |
« Reply #4 on: June 24, 2011, 06:58:13 AM » |
|
look closely to my code:
|
|
|
|
|
Logged
|
|
|
|
|
Anthony
|
 |
« Reply #5 on: June 25, 2011, 06:00:49 AM » |
|
Thanks
However seems to only work for version 3.0 (ie jsLinb3.0)
I recently downloaded package 4.0 but it would not work, not even a simple ajax html call back would work only in version 3.0
Anthony
|
|
|
|
|
Logged
|
|
|
|
|
Anthony
|
 |
« Reply #6 on: July 02, 2011, 04:26:26 AM » |
|
Now works.
Thanks
|
|
|
|
|
Logged
|
|
|
|
|
Anthony
|
 |
« Reply #7 on: July 04, 2011, 08:11:54 AM » |
|
Hi All
Manage to get a handle on jsLinb etc however one problem I seems to be stuck on.
given the following: I am using a combo dropdown once you type a few characters and then click the down arrow to the right a filter sql response list is feedback as expected.
nb: I'm using the ' _datacombo1_beforecombopop' to request the list
My question is a/ Is their an event onItemSelected ie to select from the list and not send off another db request b/ If not how can I get an equivalent with the combination of events that exisit.
ie I need to know that I have selected from the list and not simply triggered onChange, which would fire off another db request. which result in two to three db request for something that it already responded to.
Most things I've manage to figure out.
Once again I'll like to congrat the team.
This is such a great project. keep up the good work.
Anthony
|
|
|
|
|
Logged
|
|
|
|
|
linb
|
 |
« Reply #8 on: July 04, 2011, 04:35:15 PM » |
|
Class('App', 'linb.Com',{ Instance:{ iniComponents : function(){ // [[code created by jsLinb UI Builder var host=this, children=[], append=function(child){children.push(child.get(0))}; append( (new linb.UI.ComboInput) .setHost(host,"ctl_comboinput2") .setLeft(220) .setTop(70) .setLabelCaption("ctl_comboinput2") .beforeComboPop("_ctl_comboinput2_beforecombopop") ); append( (new linb.UI.List) .setHost(host,"ctl_list1") .setItems([{"id":"a", "caption":"item a", "image":"img/demo.gif"}, {"id":"b", "caption":"item b", "image":"img/demo.gif"}, {"id":"c", "caption":"item c", "image":"img/demo.gif"}, {"id":"d", "caption":"item d", "image":"img/demo.gif", "disabled":true}]) .setLeft(350) .setTop(260) .setVisibility("hidden") .setDirtyMark(false) .onItemSelected("_ctl_list1_onitemselected") ); return children; // ]]code created by jsLinb UI Builder }, _ctl_comboinput2_beforecombopop : function (profile, pos, e, src) { var ns = this; // you can show any linb.UI or linb.Com for the comboinput ns.ctl_list1.setUIValue(null).getRoot().popToTop(pos); ns.ctl_list1.getRoot().setBlurTrigger(_(), function(){ ns.ctl_list1.getRoot().hide(); }); linb.Event.keyboardHookUp('esc',0,0,0,function(){ ns.ctl_list1.getRoot().hide(); ns.ctl_comboinput2.activate(); }); // stop the default pop list return false; }, // any events for the pop linb.UI/linb.Com _ctl_list1_onitemselected : function (profile, item, e, src, type) { linb.message("_ctl_list1_onitemselected"); _.asyRun(function(){ profile.boxing().hide(); }); } } });
|
|
|
|
« Last Edit: July 04, 2011, 06:26:11 PM by linb »
|
Logged
|
|
|
|
|
Anthony
|
 |
« Reply #9 on: July 05, 2011, 01:17:14 AM » |
|
Thanks for the work around.
This is such an important feature for a combo list maybe is can be added in the next revision.
|
|
|
|
|
Logged
|
|
|
|
|
linb
|
 |
« Reply #10 on: July 05, 2011, 02:06:44 AM » |
|
OK. I added a property popCtrlEvents to linb.UI.ComboInput.
|
|
|
|
|
Logged
|
|
|
|
|
Anthony
|
 |
« Reply #11 on: July 05, 2011, 08:29:54 AM » |
|
Thanks I'll check it out
|
|
|
|
|
Logged
|
|
|
|
|
Anthony
|
 |
« Reply #12 on: July 11, 2011, 03:16:17 AM » |
|
Have anyone an example how to use getPopCtrlEvents
ie that only one request made and I can select the data from the drop down list
many thanks
|
|
|
|
|
Logged
|
|
|
|
|
Anthony
|
 |
« Reply #13 on: August 21, 2011, 04:36:53 AM » |
|
Hi Linb
I am still having problem with the combodroplist. Let me explain further
In such program language as vb,c' c++ etc as well as having a listItem that is displayed you can also bound a seperate field eg id. Therefore when you select an item from the list you can also obtain the bound field value.
Now as jsLinb uses JSON format is there a mean do the following eg
snippet
append( (new linb.UI.ComboInput) .setHost(host,"ctl_comboinput2") .setLeft(220) .setTop(230) .setWidth(360) .setLabelCaption("ctl_comboinput2") .setType("listbox") .setItems([{"id":"a", "caption":"item a"}, {"id":"b", "caption":"item b"}, {"id":"c", "caption":"item c"}, {"id":"d", "caption":"item d"}]) .afterUIValueSet("_ctl_comboinput2_afteruivalueset") );
_ctl_comboinput2_afteruivalueset : function (profile,oldValue,newValue){ var ns = this, uictrl = profile.boxing(); // var res = ns.ctl_comboinput2.getselectedrow(); // where res would be {"id":"b","caption":"item b"} // assuming that you selected item b from the dropdown }
eg
if i had a list of patients [{"id":"Number","caption":"Name"},{.............}]
once i select the patient from the dropdown display i would also need the id number
Can you please give an example of how to do this. I'm not sure what I am missing.
Many thanks
Anthony.
|
|
|
|
|
Logged
|
|
|
|
|
linb
|
 |
« Reply #14 on: August 21, 2011, 07:14:05 PM » |
|
Class('App', 'linb.Com',{ Instance:{ iniComponents : function(){ // [[code created by jsLinb UI Builder var host=this, children=[], append=function(child){children.push(child.get(0))};
append( (new linb.UI.ComboInput) .setHost(host,"ctl_comboinput2") .setLeft(220) .setTop(230) .setWidth(360) .setLabelCaption("ctl_comboinput2") .setType("listbox") .setItems([{"id":"a", "caption":"item a"}, {"id":"b", "caption":"item b"}, {"id":"c", "caption":"item c"}, {"id":"d", "caption":"item d"}]) .afterUIValueSet("_ctl_comboinput2_afteruivalueset") );
return children; // ]]code created by jsLinb UI Builder }, _ctl_comboinput2_afteruivalueset : function (profile,oldValue,newValue){
// the ‘newValue‘ is id linb.log(newValue); // You can get the item object like this: linb.log(profile.getItemByItemId(newValue));
} } });
|
|
|
|
|
Logged
|
|
|
|
|