combobox editor
combobox editor
Greeting, I am using Inline editing with a submit button to a column to implement a combobox with the system of Joined tables, these records are created empty is to say that only the first data is entered when it is edited. I discovered that when I edit any cell in the registry I automatically edit the combobox by selecting the first name in the list. Any idea how I can control this or how do I make the first item in the combobox list blank? Thanks for the help.
In the staff.php
Field::inst( 'dettagli.idClienti' )
->options( Options::inst()
->table( 'clienti' )
->value( 'idClienti' )
->label( 'nome' )
),
->validator( Validate::dbValues() ),
Field::inst( 'clienti.nome' ),
In the Javascript
label: "Acquirente:",
name: "dettagli.idClienti",
type: "select"
},
{ data: "clienti.nome", editField: "dettagli.idClienti" },
This question has an accepted answers - jump to answer
Answers
somebody help me?
I need at least the first item in the combobox to be blank so that I do not select a valid item from the list, How do I make the first item blank?
Could you give me a link to the page showing the issue so I can help debug it please? The
select
element should take the current value when you trigger editing on the row, and absolutely should not be setting itself to the first item in the list. That suggests to me that the value of the row isn't in the list of options available.Thanks,
Allan
Hello Allan, thank you for responding, I apologize for the fact that I have formulated the question incorrectly, what happens is the following. I have a cell with a select where a list is displayed works perfect. The problem is that when I edit any cell within the row, edit the cell with the select.
The select is in custom, try to update any cell other than custom and you will see how to update custom automatically. Thanks for the help.
http://paracabellos.com/dettagli/core/vista/dettagli.php?valor=3890
Any suggestions?
What's happening is that the following options are being loaded into your
select
:That's fine, but as you will be able to see, none of the options values are an empty string. That means that if the cell is currently empty it can't find an option matching the current value, thus it takes the value of the first option - labeled
NAME 1
in this case.The way to handle this is to make use of the placeholder options of the
select
field type:That will basically just add an empty string to the options list for your automatically.
Allan
Thanks Allan, you are a genius Working 100%