jQWidgets Forums
jQuery UI Widgets › Forums › Grid › My grid is not working anymore
Tagged: angular grid, bootstrap grid, javascript grid, jquery grid, jqwidgets grid, jqxgrid not working
This topic contains 1 reply, has 2 voices, and was last updated by Christopher 8 years, 6 months ago.
-
Author
-
Hey guys, my project here was working good. Everything was normal.
I left my project on side for like 1 month and i did not change anything. I was working in another project.
But now i opened my project and everything is working but my grid is not loading.
Can you guys help me ?? Even my backup codes are not working. Could it be IIS server ??
My code below.@model IEnumerable<Planilhas.Models.Requisicao>
<h4>
@{
ViewBag.Title = “Index”;
}@{
ViewBag.Title = “ListaFinanceiro”;
}</h4>
@section scripts {<script type=”text/javascript” src=”../../scripts/jquery-1.11.1.min.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqx-all.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxgrid.filter.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxgrid.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxgrid.columnsresize.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxgrid.columnsreorder.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxgrid.edit.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxgrid.sort.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxdatetimeinput.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxcalendar.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxtooltip.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxdatetimeinput.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxmenu.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxlistbox.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxdropdownlist.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxscrollbar.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxbuttons.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxdata.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxcore.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxgrid.selection.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/globalization/globalize.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxcalendar.js”></script><script type=”text/javascript” src=”../../jqwidgets/jqxgrid.pager.js”></script>
<script type=”text/javascript” src=”../../jqwidgets/jqxdatetimeinput.js”></script><script type=”text/javascript” src=”../../jqwidgets/jqxdata.export.js”></script>
<script type=”text/javascript” src=”~/Scripts/LocalizationObj.js”></script>
<script type=”text/javascript” src=”~/Scripts/buttons.js”></script><link rel=”stylesheet” type=”text/css” href=”/jqwidgets/styles/jqx.base.css” />
<link rel=”stylesheet” href=”/jqwidgets/styles/jqx.energyblue.css” type=”text/css” />
<style type=”text/css”>
</style><script type=”text/javascript”>
$(document).ready(function () {var source =
{
datatype: “json”,
datafields: [
{ name: ‘ID’, type: ‘number’ },
{ name: ’empresa1′, type: ‘string’ },
{ name: ‘ano_despesa’, type: ‘int’ },
{ name: ‘mes_despesa’, type: ‘string’ },
{ name: ‘categoria_despesa’, type: ‘string’ },
{ name: ‘unidade’, type: ‘string’ },
{ name: ‘usuario’, type: ‘string’ },
{ name: ‘alteracao’, type: ‘date’ },],
id: ‘ID’,
url: ‘/Requisicao/GetListar/’,filter: function () {
// update the grid and send a request to the server.
$(“#jqxgrid”).jqxGrid(‘updatebounddata’, ‘filter’);
},
sort: function () {
// update the grid and send a request to the server.
$(“#jqxgrid”).jqxGrid(‘updatebounddata’, ‘sort’);},
root: ‘Rows’,
beforeprocessing: function (data) {
source.totalrecords = data.TotalRows;
}
};var columnsrenderer = function (value) {
return ‘<div style=”text-align: center; margin-top: 5px;”>’ + value + ‘</div>’;
};var dataadapter = new $.jqx.dataAdapter(source, {
loadError: function (xhr, status, error) {
alert(error);
}
});$(“#jqxgrid”).jqxGrid(
{
width: 1140,
height:347,
source: dataadapter,
sortable: true,
filterable: true,
selectionmode: ‘singlerow’,
pageable: true,
virtualmode: true,
theme: ‘energyblue’,
//mudando o nome do meu filtro para portugues
ready: function () {
$(“#jqxgrid”).jqxGrid(‘localizestrings’, localizationobj);},
rendergridrows: function (obj) {
return obj.data;
},columns: [
{ text: “Id”, datafield: “ID”, cellsalign: ‘center’, cellsformat: ‘d’, width: 50, renderer: columnsrenderer },
{ text: “Ano”, datafield: “ano_despesa”, cellsalign: ‘center’, cellsformat: ‘d’, width: 70, renderer: columnsrenderer },
{ text: “Mês”, datafield: “mes_despesa”, cellsalign: ‘center’, cellsformat: ‘d’, width: 80, renderer: columnsrenderer },
{ text: “Categoria”, datafield: “categoria_despesa”, cellsalign: ‘center’, cellsformat: ‘d’, width: 190, renderer: columnsrenderer },
{ text: “Empresa”, datafield: “empresa1”, cellsalign: ‘center’, width: 125, renderer: columnsrenderer },
{ text: “Unidade”, datafield: “unidade”, cellsalign: ‘center’, width: 170, renderer: columnsrenderer },
{ text: “Usuario”, datafield: “usuario”, cellsalign: ‘center’, width: 115, renderer: columnsrenderer },
{
text: “Data de Alteração”, datafield: “alteracao”, cellsalign: ‘center’, width: 150, renderer: columnsrenderer, filterable: false, cellsformat: ‘dd/MM/yyyy HH:mm:ss’, filtertype: “date”, createfilterwidget: function (column, columnElement, widget) {
$(widget).jqxDateTimeInput({ formatString: ‘dd/MM/yyyy’ });
}
},
{
text: “Ver”, width: 63, renderer: columnsrenderer, filterable: false, sortable: false, columntype: ‘button’,
cellsrenderer: function () {
return “Ver”;
//função ao clicar no botao
}, buttonclick: function (row) {
var rowindex = $(‘#jqxgrid’).jqxGrid(‘getselectedrowindex’);
var dados = $(‘#jqxgrid’).jqxGrid(‘getrowdata’, rowindex);
var rowid = dados.ID;
var ID = rowid;
window.location = “@Url.Action(“Details/”, “Requisicao”)” + ID;}
},
{
text: “Editar”, width: 63, renderer: columnsrenderer, filterable: false, sortable: false, columntype: ‘button’,
cellsrenderer: function () {
return “Editar”;
}, buttonclick: function (row) {
var rowindex = $(‘#jqxgrid’).jqxGrid(‘getselectedrowindex’);
var dados = $(‘#jqxgrid’).jqxGrid(‘getrowdata’, rowindex);
var rowid = dados.ID;
var ID = rowid;
window.location = “@Url.Action(“Edit/”, “Requisicao”)” + ID;}
},
{
text: “Excluir”, width: 64, renderer: columnsrenderer, filterable: false, sortable: false, columntype: ‘button’,
cellsrenderer: function () {
return “Excluir”;
}, buttonclick: function (row) {
var rowindex = $(‘#jqxgrid’).jqxGrid(‘getselectedrowindex’);
var dados = $(‘#jqxgrid’).jqxGrid(‘getrowdata’, rowindex);
var rowid = dados.ID;
var ID = rowid;
window.location = “@Url.Action(“Delete/”, “Requisicao”)” + ID;}
},
],
}
)});
</script>
}
<html>
<head><link rel=”stylesheet” href=”https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css”>
<link rel=”stylesheet” href=”~/Content/Lista.css” type=”text/css” />
</head>
@if (Request.IsAuthenticated && @ViewBag.title != “Login”)
{
<body>
<div id=”criarPla”>
<i class=”glyphicon glyphicon-plus” title=”Criar planilha”></i>
<span class=”nome” style=”color:#4784AB; font-family:’Lucida Sans’; margin-left:10px;”>Requisição de Pagamento</span>
</div>
<div id=”jqxgrid” style=”font-size: 13px; font-family: Verdana; height:400px; width:1140px; background-color:white”></div>
<div id=’grid-panel’ class=’scroll’ style=”margin-top:10px;”>
<input type=”button” value=”ImprimiR” id=”meuBotao” onClick=”window.open(‘/relatorio.aspx’, ‘_blank’)”/>
<input type=”button” value=”Exportar para PDF” id=’pdfExport’ />
<input type=”button” value=”Imprimir” id=’print’ />
</div><div style=’margin-top: 20px;’>
<div style=’float: left;’>
<div style=’margin-left: 10px; float: left;’></div>
</div>
</div></body>
}
</html>Hi anderson_tuy,
The jqxWidgets files that you’re using are local(on your machine) so the problem can’t be in them. The problem is most likely in the server that you’re using, not the code itself.
Best Regards,
ChristopherjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.