最近做一个项目时,需要在dataGird中插入<input>,即文本输入框,当点击提交时,需要把文本框里填的数据返以及其他列的一些信息以json数组的格式返回到后台,虽然我实现了该功能,但一直没找到简便的方法,今天终于在一位版主的点拨下找到了非常简单的方法。 var all = $("#dg").datagrid("getData");var json =JSON.
Description Given two binary strings, return their sum (also a binary string). For example, a = “11” b = “1” Return “100”. Solution class Solution {public:string addBinary(string a, string b)
Description The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, … 1 is read off as “one 1” or 11. 11 is read off as “two 1s” or 21. 21 is read of
Description Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Solution 暴力法。 class Solution {public:int strStr(string haystack, string needl
Description Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Solution 将两个有序链表合并成一个链表。(定义一个头结点,方便返回) /**
Description Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid. The brackets must close in the correct order, “()” and “()[]{}” are
Description Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. Solution 这个题只要知道转换规则,遍历一遍字符串就行。 class Solution {public:int romanToInt(stri
Description Determine whether an integer is a palindrome. Do this without extra space. Solution 判断一个整型数是否为回文。如果将integer全翻转,可能会导致整数溢出。但这并不影响判断,因为若是回文,则翻转必不会溢出。 class Solution {public:bool isPalind
So Easy!Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:65536KBTotal submit users: 18, Accepted users: 8Problem 13150 : No special judgementProblem description A sequence Sn is defined
An Easy Puz 时间限制(普通/Java):1000MS/3000MS 运行内存限制:65536KByte 描述 Wddpdh find an interesting mini-game in the BBS of WHU, called “An easy PUZ”. It’s a 6 * 6 chess board and each cell has a nu
Palindromes _easy version Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 24195 Accepted Submission(s): 14903 Pro
Description When Teddy was a child , he was always thinking about some simple math problems ,such as “What it’s 1 cup of water plus 1 pile of dough ..” , “100 yuan buy 100 pig” .etc.. One day Te