Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
multiselected field with data url don't show me all values selected after an insert
23/04/2013
14:28
Avatar
leerickx
brussels
Member
Members
Forum Posts: 9
Member Since:
18/02/2013
sp_UserOfflineSmall Offline

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

23/04/2013
16:52
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

23/04/2013
17:34
Avatar
leerickx
brussels
Member
Members
Forum Posts: 9
Member Since:
18/02/2013
sp_UserOfflineSmall Offline

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.

25/04/2013
16:12
Avatar
leerickx
brussels
Member
Members
Forum Posts: 9
Member Since:
18/02/2013
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information