Nov 05, 2014, 5:45 AM
[CLOSED] Problem with Combobox Select Handler
Hi,
In my example I have a combobox and a Button and with combox's Select.Handler I set the button's visibility.but problem is if I not set a delay for select Handler there are a java-script error so I set
EXAMPLE VIEW
In my example I have a combobox and a Button and with combox's Select.Handler I set the button's visibility.but problem is if I not set a delay for select Handler there are a java-script error so I set
l.Select.Delay = 1;
java-script error is resolved and the code works fine,but the problem is the button visible once and next moment disrepair.which is not looks good,if set l.Select.Delay = 100;
then its understand properly.Is there any other way to this.EXAMPLE VIEW
@model e.Controllers.combobox
@{
Layout = null;
var X = Html.X();
}
@X.ResourceManager()
@(X.ComboBoxFor(obj=>obj.selected)
.FireSelectOnLoad(true)
.Items
(
new ListItem("Yes",true),
new ListItem("No",false)
)
.Listeners(l=>{
l.Select.Delay = 50;
l.Select.Handler=@"var v=this.getValue()
if(Ext.isDefined(v)==true && v=='true')
{
App.btn.setVisible(true);
}
else
{
App.btn.setVisible(false);
}
";
}))
@(X.Button().ID("btn").Text("Button"))
Example Controllerpublic class cobbo_selected_changeController : Controller
{
//
// GET: /cobbo_selected_change/
public ActionResult Index()
{
combobox _combobox = new combobox();
_combobox.selected = false;
return View(_combobox);
}
}
public class combobox
{
public bool selected { get; set; }
}
Last edited by Daniil; Nov 05, 2014 at 6:31 PM.
Reason: [CLOSED]