Click TextBox in the GridView to bring up the input dialog layer. The input content is reversed and returned to the TextBox (Jquery obtains the TextBox ID in the GridView), jquerygridview
In the project, the user reports that the input box in the GridView table is too small to input, especially when the input content is too large. Ask if you can click the input box in the GridView to bring up a large content input dialog box.
Between the user's requirements, I will begin to modify.
First, I used Jquery to add a focus capture event to the TextBox in the GridView. When I click it, the pop-up content input box is broken.
Then, when the input is complete, I use the content input box (actually a TextBox) to focus on the loss event (blur ), in this event, the value is first fed back to the TextBox in the previously clicked GridView, and then the content input box is hidden.
There were no problems in most of the above fields, but the problem occurred when the value in the content input box was reversed to the TextBox clicked by the GridView. After a long time, the problem could not be solved. I went to the Internet for help later, with the guidance of a good person, I feel something slowly. After several modifications, the test was successful.
This problem may be very simple for many people, but for cainiao like me, I have learned a lot.
<Head id = "Head1" runat = "server"> <title> </title> <script type = "text/javascript" src = "js/jquery-2.1.1.js"> </script> <script type = "text/javascript"> var cc; $ (function () {$ ("# TextBox2 "). blur (function () {var alltext = $ ("# TextBox2 "). val (); $ ("#" + cc ). val (alltext); // alert (alltext); $ ("# div2 "). hide () ;})) function Test (obj) {var rr = $ (obj ). attr ("id"); $ ("# TextBox2 "). val (""); var top = ($ (window ). height ()-$ ("# div2 "). height ()/2; var left = ($ (window ). width ()-$ ("# div2 "). width ()/2; var scrollTop = $ (document ). scrollTop (); var scrollLeft = $ (document ). scrollLeft (); $ ("# div2" placement .css ({position: 'absolute ', 'top': top + scrollTop, left: left + scrollLeft }). show (); cc = rr ;}</script>