Using table join with select works fine, but how can i implement autocomplete
Using table join with select works fine, but how can i implement autocomplete
Hello at all,
first of all - sorry for my bad english but I hope you can understand me.
I working on a small Project with datatables editor. I have an table with Projects and joined this table with adresses. When i edit a project, i use the field type selcect. It works fine, I can read all my adresses from the database and i can select one from the selectlist. Then i see the selected adress and when i open the record again for editing the adress ist select. Thats fine! Here now my Problem: The table adress grows and grows. There are over 1.000 adresses in the table. Now its not so funny to search the right adress for selecting them from a dropdown list.
Now I will use the jQuery UI AutoComplete field type plugin for selecting the correct adress. The select works fine, but there are a few Problems. When I start editing, in the autocomplete text field is only the ID from the data record in the adress table. Thats not so fine. When I search there is it possible to see the description behind the ID and search in the Description. But I find no method to display the description on editor loading and for me there is no way to display the description after selecting a record. It was great when there is any option to load the correct description on editing start and use an input type hidden to store the value and use a input type text to show the description.
Here is my javascript code for loading the editor:
[code]
editor = new $.fn.dataTable.Editor( {
"ajaxUrl": "../../scripts/datatables/php/kostenstellen-server-processing.php",
"domTable": "#projects",
"fields": [
{
"label": "Status:",
"name": "kostenstellenstatus",
"type": "kostenstellenstatus",
"default": 1
},{
"label": "Abrechnung:",
"name": "kostenstellenart",
"type": "kostenstellenart",
"default": 1
}, {
"label": "Einzelrechnung:",
"name": "einzelrechnung",
"type": "einzelrechnung",
"default": 0
}, {
"label": "Kostenstelle:",
"name": "kostenstelle",
}, {
"label": "Name:",
"name": "name"
}, {
"label": "Adresse:",
"name": "id_adressen_stamm",
"type": "autoComplete",
"opts": {
"source": "search_adressen.php"
}
}, {
"label": "Land:",
"name": "id_laender_stamm",
"type": "select"
}......
[/code]
It was great if anyone can help me.
Thanks a lot and best regards!
first of all - sorry for my bad english but I hope you can understand me.
I working on a small Project with datatables editor. I have an table with Projects and joined this table with adresses. When i edit a project, i use the field type selcect. It works fine, I can read all my adresses from the database and i can select one from the selectlist. Then i see the selected adress and when i open the record again for editing the adress ist select. Thats fine! Here now my Problem: The table adress grows and grows. There are over 1.000 adresses in the table. Now its not so funny to search the right adress for selecting them from a dropdown list.
Now I will use the jQuery UI AutoComplete field type plugin for selecting the correct adress. The select works fine, but there are a few Problems. When I start editing, in the autocomplete text field is only the ID from the data record in the adress table. Thats not so fine. When I search there is it possible to see the description behind the ID and search in the Description. But I find no method to display the description on editor loading and for me there is no way to display the description after selecting a record. It was great when there is any option to load the correct description on editing start and use an input type hidden to store the value and use a input type text to show the description.
Here is my javascript code for loading the editor:
[code]
editor = new $.fn.dataTable.Editor( {
"ajaxUrl": "../../scripts/datatables/php/kostenstellen-server-processing.php",
"domTable": "#projects",
"fields": [
{
"label": "Status:",
"name": "kostenstellenstatus",
"type": "kostenstellenstatus",
"default": 1
},{
"label": "Abrechnung:",
"name": "kostenstellenart",
"type": "kostenstellenart",
"default": 1
}, {
"label": "Einzelrechnung:",
"name": "einzelrechnung",
"type": "einzelrechnung",
"default": 0
}, {
"label": "Kostenstelle:",
"name": "kostenstelle",
}, {
"label": "Name:",
"name": "name"
}, {
"label": "Adresse:",
"name": "id_adressen_stamm",
"type": "autoComplete",
"opts": {
"source": "search_adressen.php"
}
}, {
"label": "Land:",
"name": "id_laender_stamm",
"type": "select"
}......
[/code]
It was great if anyone can help me.
Thanks a lot and best regards!
This discussion has been closed.
Replies