首页 \ 问答 \ JQuery表格排序;(JQuery table sorting; problem with dynamically added rows)

JQuery表格排序;(JQuery table sorting; problem with dynamically added rows)

我正在使用jquery tablesorter插件( http://tablesorter.com/docs/ )来排序我的表。 这适用于已创建的行。 但是当我使用Jquery clone()方法动态添加一行时,排序不起作用。

即使我动态添加行,我该怎么做才能对行进行排序?


I am using a jquery tablesorter plugin(http://tablesorter.com/docs/) for sorting my tables. This works for rows that created already. But when I add a row dynamically with Jquery clone() method, sorting is not working.

What I should I do to sort rows even if I add a row dynamically?


原文:https://stackoverflow.com/questions/3722646
更新时间:2023-01-19 22:01

最满意答案

这种例外通常有一个明确的答案......下面几行。 我希望有类似的东西:

GenericADOException未处理:无法插入:[SimpleTimer.Domain.Activity] [SQL:INSERT INTO dbo.Activity([Date],Userid,Customerjob,Service,[Class],Notes,Billable,Duration)VALUES(?,?, ?,?,?,?,?,?); 选择SCOPE_IDENTITY()] ...
... - > System.Data.SqlClient.SqlException:无法将值NULL插入到'ActivityId'列中,表'DBNAME.dbo.Activity'; 列不允许空值。 INSERT失败 ....

正如我试图在上面展示的那样,最可疑的是IDENTITY正在关闭。 只需应用这样的东西

ALTER TABLE [dbo].[Activity] ALTER COLUMN [ActivityId] int NOT NULL IDENTITY(1,1)

或者更改Generator: 5.1.4.1。 发电机


This kind of exceptions usually has a clear answer ... few lines below. And I would expect something like:

GenericADOException was Unhandled: could not insert: [SimpleTimer.Domain.Activity][SQL: INSERT INTO dbo.Activity ([Date], Userid, Customerjob, Service, [Class], Notes, Billable, Duration) VALUES (?, ?, ?, ?, ?, ?, ?, ?); select SCOPE_IDENTITY()] ...
... --> System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'ActivityId', table 'DBNAME.dbo.Activity'; column does not allow nulls. INSERT fails ....

And as I tried to show above, the most suspected would be the IDENTITY beeing turned off. Just apply something like this

ALTER TABLE [dbo].[Activity] ALTER COLUMN [ActivityId] int NOT NULL IDENTITY(1,1)

Or change the Generator: 5.1.4.1. generator

相关问答

更多
  • Mongoose模型没有.insert方法,它们有.create : ContactList.create(req.body, function(err, contacts) { res.json(contacts); }); 确保您还添加了正确的错误处理。 Mongoose models don't have an .insert method, they have .create: ContactList.create(req.body, function(err, contacts) { r ...
  • 正确格式化你的SQL(引用tesxtual值或使用参数) Chekc如果数据库文件存在。 不要将数据库文件与SQL Server Management Studio Express同时附加,因为无法将相同的数据库文件连接到两个不同的SQL Server(Express)实例。 始终确保关闭数据库连接。 使用using语句可以实现这一点,无论代码块如何保留(异常或正常的程序流),Dispose()方法都会被调用。 这将始终关闭连接,并且避免了连接泄漏。 Format properly your SQL (si ...
  • 在执行之前为您的命令分配连接: cmd.Connection = con; 并删除对BeginExecuteNonQuery的调用。 它启动异步执行,然后直接启动同步执行。 您的代码的结构方式,您希望使用同步方式。 Assign the connection to your command before executing it: cmd.Connection = con; And remove the call to BeginExecuteNonQuery. It starts an async e ...
  • 每次单击按钮时都不必定义新的DataGridView ,我相信您希望在插入数据库后在现有DataGridView添加新行。 你可以做: if (cmd.ExecuteNonQuery() > 0) { DataGridViewRow row = (DataGridViewRow)dataGridView2.Rows[0].Clone(); row.Cells[0].Value = textBox1.Text.ToString(); row.Cells[1].Value = textB ...
  • 订单是保留字。 只需在您的类定义中添加一些后退标记,NHibernate将自动为您转义表名。 Order is a reserved word. just add some back ticks to your class definition and NHibernate will escape the table name for you automatically.
    处理Application.ThreadException事件以显示您自己的错误消息。 您可以将事件挂钩在main方法的顶部,如下所示: Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); 然后你需要Handler方法: static void Application_ThreadException(object sender, Syste ...
  • 看起来像StudentId是Guid 。 尝试: return session .Query() .Where(x => x.Student.StudentId.Equals(studentId)) .ToList(); 编辑:内部异常: Message=Incorrect syntax near the keyword 'Add' 生成的sql有一个名为Add的列,尝试在映射规则中重命名它。 select courseperm0_.PermissionI ...
  • 这种例外通常有一个明确的答案......下面几行。 我希望有类似的东西: GenericADOException未处理:无法插入:[SimpleTimer.Domain.Activity] [SQL:INSERT INTO dbo.Activity([Date],Userid,Customerjob,Service,[Class],Notes,Billable,Duration)VALUES(?,?, ?,?,?,?,?,?); 选择SCOPE_IDENTITY()] ... ... - > System. ...
  • 当一个表名或列名包含一个空格或它是一个保留字时,您需要将该名称括在方括号中以避免混淆解析您的命令的sql解析器。 在你的情况下,你应该写 command.CommandText = "INSERT INTO [statement workers] values(?,?,?,?,?,?,?,?,?)"; 编辑 在查看您的字段名称(并假定字段的顺序与您输入的顺序完全相同)后,您应该更改添加参数的顺序,以准确匹配表中字段的顺序。 OleDb不能使用指定的占位符来设置参数集合,因此,严格遵守字段顺序非常重要。 如 ...
  • CREATE TABLE区域中的错误导致括号和花括号出现问题。 部分应为: string createQuery = @"CREATE TABLE IF NOT EXISTS [Mytable] ( [Id] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)