jquery UI 1.8.20
doesn't include spinner, try switching to latest version.
Error: Object [object Object] has no method 'spinner' in MVC webgrid
-
13-10-2022 - |
Question
I have a web grid and i need to make a numeric up down column in the web grid. For it I am using the jQuery UI Spinner control.
just a look:
grid1.Column("Salary",format: (item) => Html.TextBox("Salary", (int)item.Salary, new { @class = "spinnertxt",@id="txt" + item.EmployeeId }), header: "Salary")))
And for creating the spinner :
<script>
jQuery(document).ready(function () {
jQuery('.spinnertxt').spinner({ min: -100 });
jQuery('.spinnertxt').spinner('option', 'max', 100);
});
</script>
but result is not expected. The browser gives an script error:
Error: Object [object Object] has no method 'spinner'
I am using the following jQuery refernces:
<script src="/Scripts/jquery-1.7.1.js"></script>
<script src="/Scripts/jquery-ui-1.8.20.js"></script>
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
I have not duplicate references of the jQuery Libraries..
please Anyone suggest.
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow