Forum
14:28
18/02/2013
Hello everybody,
I've a multiselected field.
My values come from a db mysql and I can selected some values into the box.
The insert is ok. In my db i can see the value selected.
If I choose more values, all the values are separated with a coma in my db, the insert is ok.... but....
My edit form show me the box with one value selected only one, if I chose 2 values I see only one...
{name:'idcognitif', index:'idcognitif', editable:true,hidden:true, editrules: {edithidden: true}, edittype:"select", formoptions:{rowpos:13, colpos:2},
editoptions:{
dataUrl:'ddlcognitif.php',
multiple: true,
size:6,
}// end edit option
my php ddlcognitif.php
<?php
include("dbconfig.php");
$sql = "SELECT * FROM cognitif";
echo '<select>';
$result = mysql_query($sql) or die("Couldn't execute query.".mysql_error());
while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
echo '<option value="'.$row['idcognitif'].'">'.$row['cognitif'].'</option>';
}
echo '</select>';
?>
What I forgot ?
Thanks 😉
Leerickx
16:52
Moderators
30/10/2007
Hello,
I'm not sure I understand rigth the problem, but when you use form edition only one row can be posted to the server instead that you have more selected one.
Only the delting rows support multiselect
Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
17:34
18/02/2013
tony said:
Hello,
I'm not sure I understand rigth the problem, but when you use form edition only one row can be posted to the server instead that you have more selected one.
Only the delting rows support multiselect
Regards
Thanks Tony
In fact, I have an "edit form" with several fields one of which is "EditType: 'select'" with in "editoptions: multiple true".
I get the values ​​with "dataURL 'ddlcognitif.php' in editoptions".
All is well in the insert when I choose two values​​, for example: memory, application. My db server side inserts data in 1,2. Correct.
I wish that when I reopened my edit form I found in the box the items I had selected. But I see one of two or three, four ... I had selected.
Now if I use the widget multiselect and it seems to work well but when I reopened my edit form I see my field empty only the text from - noneSelectedText: "Any",
dataInit: function (elem) {
setTimeout(function () {
$(elem).multiselect({
minWidth: 100, //'auto',
height: "auto",
selectedList: 6,
checkAllText: "all",
uncheckAllText: "no",
noneSelectedText: "Any",
open: function () {
var $menu = $(".ui-multiselect-menu:visible");
$menu.width("auto");
return;
}
});
}, 50);
},
I guess I have to do the opposite, but I don't see how.
Another big thank you.
16:12
18/02/2013
The problem was my request SQL. For those who would like:
$SQL = "id, GROUP_CONCAT(cognitif.cognitif) AS cognitif FROM fiche
INNER JOIN cognitif ON FIND_IN_SET (cognitif.idcognitif, fiche.idcognitif) > 0″
.$where." ORDER BY $sidx $sord LIMIT $start , $limit";
$result = mysql_query( $SQL ) or die("Couldn?t execute query.".mysql_error());
Thank you again.
Most Users Ever Online: 715
Currently Online:
33 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66