in the php & js ,
$("#abc' tr").each(function(){
$("#'abcstr").val($("#abcstr").val()+";"+$(this).attr("value"));
i can split the string post or get to the url as http://abc.com/index.php?selectlist=1;2;3;4;5;&&userid=55555;
in js i can:
$("#abc' tr").each(function(){
$("#'abcstr").val($("#abcstr").val()+";"+$(this).attr("value"));
});
var url3="'.U('Cosplaymanagerview/get_cosplaylistfilterlevelajax').'";
$.post(url3, {
getwhat:"grouplistne",
cosplayid:$("#editcosplayid").val(), befiltergroupidarray:$("#abcstr").val()},function(Result,status){ arr3 = [];
for(var key in Result)
{ arr3.push({text:Result[key].groupid+Result[key].groupname,id:Result[key].groupid});
{ arr3.push({text:Result[key].groupid+Result[key].groupname,id:Result[key].groupid});
liger.get("abc3").setData(arr3); }); }
in php i can :
$befiltergroupidarray=explode(';',$befiltergroupidarraystr);
i just to ask the question is how to split the string with ";" to json/array and how to translate the json/array to string with ";" in AI2 how to do this? thanks!
--
Did you try text split? http://appinventor.mit.edu/explore/ai2/support/blocks/text.html#split
--
If you want to build a string 1;2;3;4;5 from an AI2 list L of 5 items 1,2,3,4,5
you would run the list through a csv from list block, then
through a text block that replaces all "," with ";".
Use the text JOIN block to build the URL from the pieces of text, adding more sockets using the blue square.
and to turn it into a list, reverse the process I described above.
FAQ: FAQ for lists
--
댓글 없음:
댓글 쓰기