Nov 06, 2014, 5:38 AM
MVC Razor adding features to controls in Ext.onReady function
Hi!
I created a simple view and a button on this view. I want to set listeners or other features in Ext.onReady function.
but it does not works. here is my sample:
Thank you if you reply me faster
I created a simple view and a button on this view. I want to set listeners or other features in Ext.onReady function.
but it does not works. here is my sample:
@using Ext.Net;
@using Ext.Net.MVC;
@{
Layout = null;
var X = Html.X();
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Test</title>
</head>
<body>
@(X.ResourceManager())
<div>
@(X.Button().ID("Button1").Text("Button 1")
)
</div>
</body>
</html>
<script type="text/javascript">
Ext.onReady(function () {
App.Button1.directEvents = { click: { fn: function (item, e) { Ext.net.directRequest({ cleanRequest: true, url: "/Stocks/HandleChanges", extraParams: { "data": '111' }, control: this }); } } }
});
</script>
Thank you if you reply me faster
Last edited by Daniil; Nov 10, 2014 at 11:45 AM.
Reason: Please use [CODE] tags