Post code.
webix.ui({
id:"newtopic",
view:"window",
move:false,
modal:true,
css:"myClass",
modal:false,
position:function(sizes){
sizes.width = sizes.maxWidth - 50;
sizes.height = sizes.maxHeight - 100;
sizes.left = 25;
sizes.top = 50;
},
head:{
view:"toolbar", css:"import", cols:[
{view:"label", label: "Post new topic on forum", css:"textinfo" },
{ view:"icon", icon:"times-circle",
click: function(){ webix.$$('newtopic').hide(); }}
]
},
body:{ rows :[ { cols: [
{
id:"my_form",
view:"form", scroll:false,
rules:{
"name": webix.rules.isNotEmpty,
"place": webix.rules.isNotEmpty,
"wish": webix.rules.isNotEmpty,
},
elements: [
{ rows: [{ cols:[ {view:"text", value:'default', width:0, height:0, hidden:true, labelWidth:0, name:"wishtype", width:0, labelAlign:"right" },{view:"text", value:'', labelWidth:90, label:"My name is: ", name:"name", width:300, labelAlign:"right" }, { view:"text", value:'', labelWidth:150, name:"place", label:"Your city or country: ", width:300, labelAlign:"right" }, { view:"button", label:"POST TOPIC", id:"btnmywish", type:"form", id:"btnmywish", click:insert } ]},
{height:15},{name:'wish', config:{ theme:"advanced" }, view:"tinymce-editor"},{height:15}, { view:"button", label:"POST TOPIC", type:"form", click:insert },
]}
]
},
] } ] }
}).hide();
function insert() {
if (!$$('my_form').validate())
{
webix.alert("All fields must be filled");
return;
}
var values = $$("my_form").getValues();
webix.ajax().post("services/save_wish.php", values, function() {
webix.alert("Wonderful !<br>Your topic has been added !!!");
$$("newtopic").hide();
$$("forumid").refresh();
});
}
get code
{
container:"listB",
view:"list",
id:"forumid",
width:320,
template:"POST # : #id#. <br> Autor: #name# , From: #place# <div style='padding-left:8px'> Topic : #wish# <br> <input type='button' value='read topic and answer', class='details', style='border:0px; float:right; margin-top:15px; background:#fff; padding:5px; border-radius:10px;' ></div>",
type:{
height:152
},
select:true,
onClick:{
"details":function(e, id, trg){
$$('comunity').callEvent( "onItemDblClick", [id] );
console.log(text);
return false;
}},
on:{
onSelectChange:function(){
var arr = $$('forumid').getSelectedId(true)
//console.log(arr);
}
},
url:"services/forum.php"
}
$$("forumid").refresh(); not refresh forumid after post?
how recive at outright post in forum id? thanks