我想在我的jTable CRUD Jquery中为每一行添加一个带有somelink的静态列.我正在使用他们提供的代码,例如来自jTable网站
这是代码:
<script type="text/javascript">
$(document).ready(function () {
//Prepare jTable
$('#PeopleTableContainer').jtable({
title: 'Table of people',
paging: true,
pageSize: 5,
sorting: true,
defaultSorting: 'Name ASC',
actions: {
listAction: 'PersonActionsPagedSorted.php?action=list',
createAction: 'PersonActionsPagedSorted.php?action=create',
updateAction: 'PersonActionsPagedSorted.php?action=update',
deleteAction: 'PersonActionsPagedSorted.php?action=delete'
},
fields: {
PersonId: {
key: true,
create: false,
edit: false,
list: false
},
Name: {
title: 'Author Name',
width: '40%'
},
Age: {
title: 'Age',
width: '20%'
},
Watch: {
title: 'Watch',
width: '20%',
display: function (data) {
return '';
},
RecordDate: {
title: …
Run Code Online (Sandbox Code Playgroud) 我正在使用JQuery jTable插件来显示我的表记录.
$(document).ready(function () {
//Prepare jTable
$('#PeopleTableContainer').jtable({
title: 'Table of people',
paging: true,
pageSize: 2,
sorting: true,
defaultSorting: 'Name ASC',
actions: {
listAction: 'PersonActionsPagedSorted.php?action=list',
createAction: 'PersonActionsPagedSorted.php?action=create',
updateAction: 'PersonActionsPagedSorted.php?action=update',
deleteAction: 'PersonActionsPagedSorted.php?action=delete'
},
fields: {
PersonId: {
key: true,
create: false,
edit: false,
list: false
},
Name: {
title: 'Author Name',
width: '40%'
},
Age: {
title: 'Age',
width: '20%'
},
RecordDate: {
title: 'Record date',
width: '30%',
type: 'date',
create: false,
edit: false
},
Photo: {
title: 'Photo',
width: '50%', …
Run Code Online (Sandbox Code Playgroud) 我正在运行一个更新表上记录的循环,但我需要等待所有记录更新才能继续.
我怎样才能让jquery等到loopselectedrows函数中的所有调用完成?我读过.deferred和.when,但我不知道如何实现.他们似乎都无法处理一系列的调用,如果我在哪里切换到使用ajax帖子的数组.任何帮助将不胜感激.
这是启动它的按钮:
click: function () {
// validate all rows
var $selectedRows = $('#Table1').jtable('selectedRows');
LoopSelectedRows($selectedRows, 'Validate');
Run Code Online (Sandbox Code Playgroud)
///等待所有ajax调用完成//然后继续检查
// check for any row with an error
var $ValidatedRows = $('#Table1').jtable('selectedRows');
var boolCheck = checkValidatedRows($ValidatedRows);
// if all records are succesfull then add them
// else alert user
if (boolCheck == true) {
LoopSelectedRows($selectedRows, 'Add');
}
else {
alert("Please correct invalid records and try again");
}
}
Run Code Online (Sandbox Code Playgroud)
这样做的第一件事是从表中获取所有记录并将它们传递给循环函数.
这是循环函数 -
function LoopSelectedRows(SelectedRecords, actionType) {
if (SelectedRecords.length > 0) {
//Show selected …
Run Code Online (Sandbox Code Playgroud) 实际上我想在列表中显示来自数据库的布尔值的Checkbox
OriginatingLocation: {
title: 'Originating Location',
width: '30%',
list: true,
type:checkbox,
create: false,
edit: false
},
Run Code Online (Sandbox Code Playgroud) 我正在使用这个例子: www.jtable.org
我已经下载了jTable PHP版本.然后我编辑了脚本.jTable简单版本正在运行,但我编辑的版本不是.
我可以创建一个列表,但我不能添加一行; 这段代码导致了问题.但是,PHP不会显示任何错误消息.
else if($_GET["action"] == "create")
{
//Insert record into database
$result = mysql_query("INSERT INTO veriler(bolge, sehir, firma, adres, tel, web) VALUES('" . $_POST["bolge"] . "', '" . $_POST["sehir"] . "', '" . $_POST["firma"] . "', '" . $_POST["adres"] . "', '" . $_POST["tel"] . "', '" . $_POST["web"] . "'");
//Get last inserted record (to return to jTable)
$result = mysql_query("SELECT * FROM veriler WHERE id = LAST_INSERT_ID();");
$row …
Run Code Online (Sandbox Code Playgroud) 我正在使用jTable进行我正在进行的项目,并希望看看你们是否可以帮助解决我遇到的CSS问题.当我向jTable添加新记录时,我在弹出窗体的下方创建了一个jsfiddle.因为我有这么多行,它比可见屏幕更长.您是否认为通过一些CSS调整可以将其设为两个或三个列框?
我无法更改此表单的生成,因此它必须只是CSS.
表格的较短版本如下:
<div class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-front ui-dialog-buttons ui-draggable ui-resizable" style="position: absolute; height: auto; width: auto; top: 0px;" tabindex="-1" role="dialog" aria-describedby="ui-id-58" aria-labelledby="ui-id-59">
<div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix"><span id="ui-id-59" class="ui-dialog-title">Add new record</span>
<button class="ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only ui-dialog-titlebar-close" role="button" aria-disabled="false" title="close"><span class="ui-button-icon-primary ui-icon ui-icon-closethick"></span><span class="ui-button-text">close</span>
</button>
</div>
<div id="ui-id-58" style="width: auto; min-height: 0px; max-height: none; height: auto; display: block;" class="ui-dialog-content ui-widget-content">
<form id="jtable-create-form" class="jtable-dialog-form jtable-create-form" action="/Demo/CreateStudent" method="POST">
<div class="jtable-input-field-container">
<div class="jtable-input-label">Institution Name</div>
<div class="jtable-input jtable-text-input">
<input class="" …
Run Code Online (Sandbox Code Playgroud) 在jquery-jTable,我们可以有一些领域和行动.我需要其他按钮[可能在页面末尾]附近的Jquery JTable按钮("提交"按钮),在点击之后,运行另一个功能.所以这是我的代码:
$('#RequestSubmitDiv').jtable({
title: 'newRec',
paging: false,
sorting: false,
selecting:false;
selectingCheckBoxes:false,
selectOnRowClick:false,
jqueryuitheme:true,
formCreated:function(event,data){
data.form.validationEngine();
},
formSubmitting:function(event,data){
...
...
},
formClode: function(d,e){...} ,
actions: {
createAction: '/Adminsec/ManageAssets.aspx/CreateOrUpdate',
//---not need below
//listAction: '/Adminsec/ManageAssets.aspx/List',
//updateAction: '/Adminsec/ManageAssets.aspx/CreateOrUpdate',
//deleteAction: '/Adminsec/ManageAssets.aspx/Deletes'
//-!!---Other Button and Action Need ---!!
CustomAction:{
title:'RefreshNew',
sorting:false,
create:false,
edit:false ,
list:false ,
display:function(data){
return '<input type='button' id='MyBtn' onclick='Call_Mehod();>';
}
}
},
fields: {
ID {title:'pk',type:'textarea'} ,
RequestNO{type:'textarea'},
description{type:'textarea'}
}
});
Run Code Online (Sandbox Code Playgroud)
如何在Jquery-Jtable和调用函数中添加一些按钮?这些按钮不会在行或列重复,我的意思是它应该是字段范围之后的一个实例.
我们可以在jtable中添加自定义按钮吗?有没有可用于创建按钮的选项?
意味着如果我想要一个用于创建PDF的按钮,那我该怎么办?
如何更改+Add New Record
J-Table中的默认链接文本?
第一次使用SignalR,我遇到了一些问题.我试图做的是一旦用户将新用户添加到系统,就异步更新我的jTable.问题是,每次我尝试提交时,都会遇到下面的错误.我不确定问题是什么,因为填充我的CreateUserModel所需的所有数据都通过了.关于我做错了什么的任何想法?
错误
{"I":"0","E":"Error converting value \"UserId=19&FirstName=123&LastName=123&UserName=123&Role=Admin&Password=123123&ConfirmPassword=123123&EmailAddress=fakeEmail%40gmail.com&PhoneNumber=123\" to type 'MyProject.Models.CreateUserModel'.
Run Code Online (Sandbox Code Playgroud)
模型我试图转换为
public class CreateUserModel {
public int UserId { get; set; }
public string UserName { get; set; }
public string Password { get; set; }
public string ConfirmPassword { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public string EmailAddress { get; set; }
public string PhoneNumber { get; set; }
public string Role { get; set; }
public IEnumerable<SelectListItem> RolesItem …
Run Code Online (Sandbox Code Playgroud) jquery-jtable ×10
jquery ×9
ajax ×2
asp.net-mvc ×2
javascript ×2
php ×2
css ×1
html ×1
mysql ×1
signalr ×1