如何使用动态数据在同一局部视图的局部视图中显示grid.mvc? [英] How a grid.mvc be displayed wihin a partial view on the same partial view with dynamic data?
本文介绍了如何使用动态数据在同一局部视图的局部视图中显示grid.mvc?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
我想在与视图相同的页面上的局部视图上添加一个网格。
我还想拥有动态网格功能网格。一旦数据被插入表单中,就应该在网格中添加或更新。一旦数据输入完成,就将数据从网格提交到表格。
我怎么能这样做grid.mvc?
谢谢
我的尝试: < br $> b $ b
Hello,
I want to add a grid on the partial view on the same page as that of view.
I also want to have dynamic grid capability for the grid. As soon as , data is inserted in the form, it should get added or updated in grid.As soon as data entry is completed, submit data from the grid to table.
How can I do this with grid.mvc?
Thanks
What I have tried:
<script type="text/javascript">
$(document).ready(function () {
$('#add').click(function () {
$("form").attr("action", "FillGrid");
$('#result').load('FillGrid');
$('#result').toggle('slow');
});
});
和FillGr id如下给出 -
And FillGrid is given as follows -
public ActionResult FillGrid(FormCollection form)
{
List<string> flatlist = new List<string>();
flatlist.Add(form["Address"].ToString());
flatlist.Add(form["Area"].ToString());
flatlist.Add(form["AgreementPrice"].ToString());
flatlist.Add(form["Rate"].ToString());
ViewData["flats"] = new SelectList(flatlist);
return PartialView(flatlist);
推荐答案
( document )。ready( function (){
(document).ready(function () {
(' #add')。click( function (){
('#add').click(function () {
( form)。attr( action, FillGrid);
("form").attr("action", "FillGrid");
这篇关于如何使用动态数据在同一局部视图的局部视图中显示grid.mvc?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文