【发布时间】:2011-07-29 12:41:59
【问题描述】:
可能不是最好的标题,但我认为这就是发生的事情。
我写了this question 想在我的 jqGrid 中填充一个下拉列表,以便用户可以从可用的选项中进行筛选。提供的解决方案在一种情况下有效,但在另一种情况下无效。它检索数据的第一种类型(用于列标题下拉过滤器)我的堆栈跟踪如下所示:
callback() jquery-1.6.2.js (line 7947)
_ = readystatechange
done() jquery-1.6.2.js (line 7183)
status = 200
statusText = "success"
responses = Object { text="["Cake", "Sugar", "Waffle"]" }
headers = "Server: ASP.NET Develop...: 22\nConnection: Close\n"
resolveWith() jquery-1.6.2.js (line 1008)
context = Object { url="/IceCream/AvailableConeTypes", isLocal=false, more...}
args = [ Object { readyState=4, responseTExt="["Cake", "Sugar", "Waffle"]", more...} "success"]
complete() jquery...src.js(line 3591)
res = Object { readyState=4, responseText="["Cake", "Sugar", "Waffle"]", more...}
status = "success"
myBuildSelect() Cone (line 75)
data = Object { readyState=4, responseText="["Cake", "Sugar", "Waffle"]", more...}
第二次调用时(对于允许您构建多个 AND/OR 过滤器的 jqGrid 工具栏过滤器对话框)堆栈跟踪略有不同:
callback() jquery-1.6.2.js (line 7947)
_ = readystatechange
done() jquery-1.6.2.js (line 7168)
status = 200
statusText = "success"
responses = Object { text="["Cake", "Sugar", "Waffle"]" }
headers = "Server: ASP.NET Develop...: 22\nConnection: Close\n"
resolveWith() jquery-1.6.2.js (line 1008)
context = Object { elem=, options={...} }
args = [ "["Cake", "Sugar", "Waffle"]", "success", Object { readyState=4, responseText="["Cake", "Sugar", "Waffle"]", more...} ]
success() jquery...src.js(line 5099)
data ="["Cake", "Sugar", "Waffle"]"
status = "success"
myBuildSelect() Cone (line 75)
data = ="["Cake", "Sugar", "Waffle"]"
我对这里发生的事情感到困惑。查看引用行处的 jquery-1.6.2.js 文件,我看到在第一个实例中它执行了以下行:
deferred.resolveWith { callbackContext, [success, statusText, jqXHR] ); (line 7168)
在第二种情况下,它执行以下行:
completeDeferred.resolveWith( callbackContext, [ jqXHR, statusText] ); (line 7183)
当第二次调用该控制器操作时,似乎缓存或处理方式有所不同。如果有帮助,我可以发布其他代码,但它本质上是我在之前的问题中以及 Oleg 的解决方案中所写的。想法?
【问题讨论】:
标签: jquery asp.net-mvc jqgrid