如何在Gridmvc中设置列字体/文本颜色(我的代码在下面) [英] How Do I Set A Column Font/Text Color In Gridmvc (My Code Is Below)
问题描述
@model IEnumerable< uyilo_fms.models.vehicle_obj>
@using GridMvc.Html
@ {
}
<!DOCTYPE html>
< ; html>
< head>
< meta name =viewportcontent =with = device-width/>
< link href =@ Url.Content(〜/ Content / Gridmvc.css) =stylesheet/>
< script src =@ Url.Content( 〜/ Scripts / jquery-1.10.2.min.js)>< / script>
< script src =@ Url.Content(〜/ Scripts / gridmvc。 min.js)>< / script>
< rowdefinition height =57width =873>
< title> @ ViewBag.Title =Title< / title>
< / head>
< body>
车辆清单
@model IEnumerable<uyilo_fms.models.vehicle_obj>
@using GridMvc.Html
@{
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="with=device-width"/>
<link href="@Url.Content("~/Content/Gridmvc.css")" rel="stylesheet" />
<script src="@Url.Content("~/Scripts/jquery-1.10.2.min.js")"></script>
<script src="@Url.Content("~/Scripts/gridmvc.min.js")"></script>
<rowdefinition height="57" width="873">
<title>@ViewBag.Title = "Title"</title>
</head>
<body>
Vehicles List
@ Html.Grid(Model,GridRenderOptions.Create(VehiclesGrid) ))。列(列=>
{
columns.Add()。编码(false).Sanitized(false).RenderValueAs(c => @< img class =thumbnailsrc =~/Content/images/@c.ImagePathheight =80width =80alt =@ c.ImagePath/>);
columns.Add(c => c.displayName).Titled(Vehicle Name);
columns.Add(c => c.make).Titled(Make );
columns.Add(c => c.type).Titled(Type);
columns.Add(c => c.odometer ).Titled(里程表);
} ).WithPaging(5).Sortable(true)。
@Html.Grid(Model, GridRenderOptions.Create("VehiclesGrid")).Columns(columns =>
{
columns.Add().Encoded(false).Sanitized(false).RenderValueAs(c => @<img class="thumbnail" src="~/Content/images/@c.ImagePath" height="80" width="80" alt="@c.ImagePath" />);
columns.Add(c => c.displayName).Titled("Vehicle Name");
columns.Add(c => c.make).Titled("Make");
columns.Add(c => c.type).Titled("Type");
columns.Add(c => c.odometer).Titled("Odometer");
}).WithPaging(5).Sortable(true).
<脚本>
函数getRow(vehicle_reg){
$ .jax({
url:'@ Url.Action(DisplayTripHistory,首页)',
数据:JSON.stringify(vehicle_reg),
contentType:'application / json',
dataType:'json ',
类型:'POST',
成功:function(){
alert('SUCCESS');
},
错误:function(){
alert('错误');
}
}
);
}
< ; / script>
< / body>
< / html>
<script>
function getRow(vehicle_reg) {
$.jax({
url: '@Url.Action("DisplayTripHistory", "Home")',
data: JSON.stringify(vehicle_reg),
contentType: 'application/json',
dataType: 'json',
type: 'POST',
success: function () {
alert('SUCCESS');
},
error: function () {
alert('error');
}
}
);
}
</script>
</body>
</html>
推荐答案
.jax( {
url:'@ Url.Action(DisplayTripHistory,Home)',
数据:JSON.stringify(vehicle_reg),
contentType:'application / json',
dataType:'json',
类型:'POST',
成功:函数( ){
alert('SUCCESS');
},
错误:function(){
alert ('错误');
}
}
);
}
< / script>
< / body>
< / html>
.jax({
url: '@Url.Action("DisplayTripHistory", "Home")',
data: JSON.stringify(vehicle_reg),
contentType: 'application/json',
dataType: 'json',
type: 'POST',
success: function () {
alert('SUCCESS');
},
error: function () {
alert('error');
}
}
);
}
</script>
</body>
</html>
所有网格都在内部使用表结构。因此,您可以根据需要更改网格样式。
因此,回答您的问题将是这样的:
All the grids internally uses table structure. So you can change the grid style as per your need.
So answer to your question would be something like this:
<br />
#yourGridName tr td<br />
{<br />
color: #f44;<br />
}<br />
-KR
-KR
这篇关于如何在Gridmvc中设置列字体/文本颜色(我的代码在下面)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!