DevExpress MVC GridView 回调在第一次回调后冻结
Posted
技术标签:
【中文标题】DevExpress MVC GridView 回调在第一次回调后冻结【英文标题】:DevExpress MVC GridView callbacks frozen after first call back 【发布时间】:2014-09-30 07:41:56 【问题描述】:我在我的项目中使用 DevExpress MVC GridView,我遇到了一个有趣的问题,比如说在 GridView 的实现过程中。如果不在我的视图中使用任何其他脚本标签,GridView 工作正常,但是当我将一些脚本添加到我的视图中时,网格视图看起来非常好,但是当我单击新建、编辑或其中任何一个链接时,回调停止工作,加载面板无限显示。任何帮助将不胜感激。
@
ViewBag.Title = "Create";
Layout = "~/Views/Shared/_DevLayout.cshtml";
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>GIZ/WSIP-Operation Plan</title>
<!-- Bootstrap Core CSS -->
<link rel="stylesheet" href="../../GIZWSIP-FstComponent/css/datepicker.css">
<link rel="stylesheet" href="../../GIZWSIP-FstComponent/css/bootstrap.css">
<link href="../../GIZWSIP-FstComponent/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="../../GIZWSIP-FstComponent/css/agency.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="../../GIZWSIP-FstComponent/font-awesome-4.1.0/css/font-awesome.min.css"
rel="stylesheet" type="text/css">
<link href="../../GIZWSIP-FstComponent/css/datepicker.css"
rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet"
type="text/css">
<link href='http://fonts.googleapis.com/css?family=Kaushan+Script' rel='stylesheet'
type='text/css'>
<link href='http://fonts.googleapis.com/ css? family= Droid+Serif :400,700,400
rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700'
type='text/css'>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body id="page-top" class="index">
<!-- Navigation -->
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<span class="sr-only">Toggle navigation</span> <span class="icon- bar"></span><span
class="icon-bar"></span><span class="icon-bar"></span>
</button>
<a class="navbar-brand page-scroll" href="#page-top">Operation Plan</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li class="hidden"><a href="#page-top"></a></li>
<li><a class="page-scroll" href="#services">Create</a> </li>
<li><a class="page-scroll" href="#portfolio">Edit</a> </li>
<li><a class="page-scroll" href="#about">Activities Chart</a> </li>
<li><a class="page-scroll" href="#team">Report</a> </li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
<!-- Header -->
<header>
<div class="container">
<div class="intro-text">
<div class="intro-lead-in">
Welcome To Our Studio!</div>
<a href="#services" class="page-scroll btn btn-xl">Tell Me More</a>
</div>
</div>
</header>
<!-- Services Section -->
<section id="services">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h2 class="section-heading">
Create</h2>
<h3 class="section-subheading text-muted">
Create new Intervention Area and Activities Here.</h3>
</div>
</div>
</div>
<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/ jquery/ 1.7/jquery.js"> </script>
</head>
<body>
<div class="container">
<!-------->
<div id="content">
<ul id="tabs" class="nav nav-tabs" data-tabs="tabs">
<li onClick="window.location='http://localhost:53785/firstcmoutputs /Create#services'"><a href="http://localhost:53785/firstcmoutputs/Create#services" data-toggle="tab">Output</a></li>
<li onClick="window.location='http://localhost:53785/firstcmActivities /Create#services'"><a href="http://localhost:53785/firstcmActivities/Create#services" data-toggle="tab">Activities</a></li>
</ul>
<div id="my-tab-content" class="tab-content">
<div class="tab-pane active" id="Output">
<div> </div>
@using (Html.BeginForm())
@Html.ValidationSummary(true)
@Html.Partial("_OutputsCreateOrEdit")
</div>
</div>
</div>
</div> <!-- container -->
</body>
</html>
</section>
<!-- Portfolio Grid Section -->
<section id="portfolio" class="bg-light-gray">
@Html.Action("GridViewPartial")
</section>
<!-- About Section -->
<section id="about">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h2 class="section-heading">
About</h2>
<h3 class="section-subheading text-muted">
Lorem ipsum dolor sit amet consectetur.</h3>
</div>
</div>
</section>
<footer>
<div class="container">
<div class="row">
<div class="col-md-4">
<span class="copyright">Copyright © GIZ-WSIP 2014</span>
</div>
<div class="col-md-4">
<ul class="list-inline social-buttons">
<li><a href="#"><i class="fa fa-twitter"></i></a></li>
<li><a href="#"><i class="fa fa-facebook"></i></a></li>
<li><a href="#"><i class="fa fa-linkedin"></i></a></li>
</ul>
</div>
<div class="col-md-4">
<ul class="list-inline quicklinks">
<li><a href="#">Privacy Policy</a> </li>
<li><a href="#">Terms of Use</a> </li>
</ul>
</div>
</div>
</div>
</footer>
<!-- jQuery Version 1.11.0 -->
<script src="../../GIZWSIP-FstComponent/js/jquery-1.11.0.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="../../GIZWSIP-FstComponent/js/bootstrap.min.js"></script>
<!-- Plugin JavaScript -->
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-easing /1.3/jquery.easing.min.js"></script>
<script src="../../GIZWSIP-FstComponent/js/classie.js"></script>
<script src="../../GIZWSIP-FstComponent/js/cbpAnimatedHeader.js"></script>
<!-- Contact Form JavaScript -->
<script src="../../GIZWSIP-FstComponent/js/jqBootstrapValidation.js"></script>
<script src="../../GIZWSIP-FstComponent/js/contact_me.js"></script>
<!-- Custom Theme JavaScript -->
<script src="../../GIZWSIP-FstComponent/js/agency.js"></script>
<script src="../../GIZWSIP-FstComponent/js/bootstrap-datepicker.js"></script>
<script src="../../GIZWSIP-FstComponent/js/jquery.js"></script>
<script src="../../GIZWSIP-FstComponent/js/bootstrap.js"></script>
</body>
</html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Datepicker - Default functionality</title>
<link rel="stylesheet" href="../../GIZWSIP-FstComponent/css/jquery-ui.css">
<script src="../../GIZWSIP-FstComponent/js/jquery-1.11.0.js"></script>
<script src="../../GIZWSIP-FstComponent/js/jquery-ui.js"></script>
<script>
$(function ()
$("#PlanningFrom").datepicker();
$("#PlanningTo").datepicker();
$("#DateOfPlanning").datepicker();
);
</script>
</head>
</html>
【问题讨论】:
【参考方案1】:我认为在您的情况下,不同的 js 文件相互冲突。
尝试使用$.noConflict()
来避免jquery 文件之间的冲突:-
点击此链接:
http://api.jquery.com/jquery.noconflict/
【讨论】:
您能否再给我一些提示如何做到这一点?因为我有很多 @NaserDostdar ...您可以访问 anser 中给出的链接..它将为您提供完整的解释... 我不得不说我已经删除了所有有冲突的 Jquery 脚本,这意味着我将所有的 Jquery 文件都更改为一个 Jquery 文件,但即使是同样的错误你知道吗? @NaserDostdar...请发布一些代码..以便我们可以轻松解决您的问题..thankzz... 请查看编辑...谢谢以上是关于DevExpress MVC GridView 回调在第一次回调后冻结的主要内容,如果未能解决你的问题,请参考以下文章
如何在 Devexpress MVC GridView 上获取选定的行?
基于所选行的 Devexpress MVC Gridview 自定义排序
devexpress gridview 中选择多行 剪切,粘帖功能怎么做?