列标题未按设计显示
Column Title not showing as designed
ShieldUI v 1.7.36 NP
URL: http://hccm.org/gala_signup_list.php
代码
HTML:
<div class="about-bottom">
<div class="col-md-12 about-left">
<div id="grid"></div>
</div>
</div>
Javascript:
$(document).ready(function() {
$('#return_btn').click(function() {
window.location = 'gala.php';
})
plgrid = $("#grid").shieldGrid({
dataSource: {
remote: {
read: {
url: "api/GetGalaSignupList",
dataType: "json",
xhrFields: {
withCredentials: false
}
}
},
noRecordsText: "There are no Registrants",
columns: [
{field:'registrant_name', title: "Registrant Name", width: "30%"},
{field: 'registrant_email', title: "Email", width: "30%"},
{field: 'registrant_phone', title: "Phone"},
{field: 'registrant_mail', title: "Address", width: "30%"},
{field: 'table_name', title: "Table Name", width: "20%"},
{field: 'numtix', title: "Num Tix", width: "20%"}
]
}
});
plgrid.show();
});
数据,<snip>
数据可见URL
[
{
"registrant_name":"Jeff Seiler",
"registrant_email":"<snip>",
"registrant_phone":"<snip>",
"registrant_mail":"507 Las Colinas",
"ticket_type":"Individual",
"table_name":"Mr and Mrs Jeff Seiler",
"numtix":"2"
},
{
"registrant_name":"Jan Halstead",
"registrant_email":"<snip>",
"registrant_phone":"<snip>",
"registrant_mail":"115 Mason Oaks",
"ticket_type":"Individual",
"table_name":"",
"numtix":"1"
}
]
但它不显示基于标题属性的标题,它只显示 JSON 列名称。我做错了什么导致这个?我可以更改 JSON 但我想知道为什么 title 属性不起作用。
我看到您正在从 url 远程读取数据,我认为您应该定义一个
数据源中使用的字段的模式。你可以在这里查看他们的情况
定义。您应该指出路径和数据类型。
https://www.shieldui.com/documentation/datasource/javascript/api/settings/schema/fields
我怀疑没有显示标题的原因是您没有定义字段架构。
ShieldUI v 1.7.36 NP
URL: http://hccm.org/gala_signup_list.php
代码
HTML:
<div class="about-bottom">
<div class="col-md-12 about-left">
<div id="grid"></div>
</div>
</div>
Javascript:
$(document).ready(function() {
$('#return_btn').click(function() {
window.location = 'gala.php';
})
plgrid = $("#grid").shieldGrid({
dataSource: {
remote: {
read: {
url: "api/GetGalaSignupList",
dataType: "json",
xhrFields: {
withCredentials: false
}
}
},
noRecordsText: "There are no Registrants",
columns: [
{field:'registrant_name', title: "Registrant Name", width: "30%"},
{field: 'registrant_email', title: "Email", width: "30%"},
{field: 'registrant_phone', title: "Phone"},
{field: 'registrant_mail', title: "Address", width: "30%"},
{field: 'table_name', title: "Table Name", width: "20%"},
{field: 'numtix', title: "Num Tix", width: "20%"}
]
}
});
plgrid.show();
});
数据,<snip>
数据可见URL
[
{
"registrant_name":"Jeff Seiler",
"registrant_email":"<snip>",
"registrant_phone":"<snip>",
"registrant_mail":"507 Las Colinas",
"ticket_type":"Individual",
"table_name":"Mr and Mrs Jeff Seiler",
"numtix":"2"
},
{
"registrant_name":"Jan Halstead",
"registrant_email":"<snip>",
"registrant_phone":"<snip>",
"registrant_mail":"115 Mason Oaks",
"ticket_type":"Individual",
"table_name":"",
"numtix":"1"
}
]
但它不显示基于标题属性的标题,它只显示 JSON 列名称。我做错了什么导致这个?我可以更改 JSON 但我想知道为什么 title 属性不起作用。
我看到您正在从 url 远程读取数据,我认为您应该定义一个 数据源中使用的字段的模式。你可以在这里查看他们的情况 定义。您应该指出路径和数据类型。
https://www.shieldui.com/documentation/datasource/javascript/api/settings/schema/fields
我怀疑没有显示标题的原因是您没有定义字段架构。