Hi, in my lightbox, i have right now a dropdown witch show a client list from mysql database. But now, I have something like 400 customers in that dropdown. Is is possible to have an auto search field that will search in my client list. So in other words, I would like to have an empty box in witch I can type the customer’s name and then it will find it for me and I can select it instead of having a simple dropdown list of 300 customeers
Her’s my code below
Tks
Seby
Hi Stanislav, I tried with my developper to apply the code… See below. But now the problem we have is this…
The Combo Select Edit Not working with scheduler. I have used client id as value and client name as text. When I save with the client name, it’s working, but when I edit the same record I just saved, The client field show only the Client id . whne i save it again then, it get empty. can you help me to fix it please?
tks
Seby
include (’…/…/common/config.php’);
$res=mysql_connect($server,$user,$pass);
mysql_select_db($db_name);
require("…/…/…/codebase/combo_connector.php");
$combo = new ComboConnector($res);
$combo->render_table(“clients”,“id”,“full_name”);
Unfortunately this one takes more time then expected.
Combo as it used now in scheduler, doesn’t suite very well for above scenario. ( it loads data only after lightbox opening and can convert value to label after that ). We will provide fix, but I’m not sure when it will be available
Want to share a hack on how to go about this issue, as seen below. The code is added into the “onLightbox” event:
// since no fixed id to identify, I used the css class
// but best if an id for the combobox is present
get_account_code_of = $('.dhx_combo_input').val();
// connects via AJAX to the server-side to get the
// corresponding text value of the numeric code
post_url = base_url+"/connector/";
$.ajax({
url: post_url,
type: "GET",
data: ({'get_account_code_of': get_account_code_of}),
success: function(data)
{
// substitute the text code to the numeric code
$('.dhx_combo_input').val(data);
}
});
Got the true hack this time. Since Stanislav has been honest about the fix for this issue may need much time, I can’t afford to wait, so I deviced a hack for it.
First, I observed that the onClick event in the combobox is always triggered and a GET method is triggered each time,
… which in effect returns the XML that contains the exact id of the chosen text searched.
Second, this GET method, if not done prior to saving the Lightbox form, will cause the data in the combobox to save blank data to the db once saving the Lightbox form is deliberately done.
Though I suspect an internal mechanism to fetch and reload the XML data is done every time onClick event is triggered, I then used
$('.dhx_combo_input').click();
to programmatically trigger that mechanism. And so far, for several tests, everything works fine, either dragging the event or manually changing the dates works perfectly.
Hi again Stanislav, it’s been a while since your last answer… i’m still waiting for a little bit of help. Would it be possible to have an answer please?.
Thank you very much for your help.
Seby
This issue is not resolved yet.
I am sorry for the inconvenience this have caused.
It is in work though and as soon as update is ready - it will be posted.