找回密码
 立即注册

QQ登录

只需一步,快速开始

drwooh

注册会员

1

主题

16

帖子

155

积分

注册会员

积分
155

活字格认证

最新发帖
drwooh
注册会员   /  发表于:2015-8-10 08:35  /   查看:5743  /  回复:7

  
为什么textbox1可以,C1InputText1不起作用呢
  请帮忙解决一下,非常感谢

   
         $("#TextBox1").val(str);   -->   可以
          $(this).val(str);              -->   不起作用

   源码放不上去,老是出现发帖失败,内容中有不符合新用户强力广告屏蔽规则的字符,请检查标题和内容,如有疑问请与管理员联系

   真头痛,什么原因呢,只好换成图片了,

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

7 个回复

倒序浏览
Alice
社区贡献组   /  发表于:2015-8-10 11:42:00
沙发
回复 1楼drwooh的帖子

谢谢你的反馈。
你的问题我们收到了,需要对你的代码进行测试,测试后给你回复。

有关你提到帖代码的问题,你可以在发帖的时候,选择“添加代码文字”的按钮,然后贴出代码。
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2015-8-10 15:03:00
板凳
回复 1楼drwooh的帖子

很抱歉你的问题我们不能重现。
请提供一个重现问题的Demo,我们在帮你看看。
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
drwooh
注册会员   /  发表于:2015-8-10 17:14:00
地板

请看一下

谢谢 Alice版主 的回复,付上源码,请看一下


  1. <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Demo.aspx.vb" Inherits="Demo" %>

  2. <%@ Register assembly="C1.Web.Wijmo.Controls.4" namespace="C1.Web.Wijmo.Controls.C1Input" tagprefix="wijmo" %>

  3. <!DOCTYPE html>

  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head runat="server">
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  7. <title>Demo</title>

  8. <style type="text/css">
  9. .focus {
  10. background: #ccccff;
  11. }
  12. </style>

  13. </head>
  14. <body>
  15. <form id="form1" runat="server">

  16. <br />

  17. <table>
  18. <tr>
  19. <td>
  20. input
  21. </td>

  22. <td>
  23. C1InputText1<br />
  24. <wijmo:C1InputText ID="C1InputText1" runat="server" HideEnter="True">
  25. </wijmo:C1InputText>
  26. </td>

  27. <td>
  28. dummy TextBox<br />
  29. <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
  30. </td>

  31. <td>
  32. TextBox1<br />
  33. <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
  34. </td>
  35. </tr>


  36. <tr>
  37. <td>
  38. display
  39. </td>

  40. <td>
  41. C1InputText2<br />
  42. <wijmo:C1InputText ID="C1InputText2" runat="server" HideEnter="True">
  43. </wijmo:C1InputText>
  44. </td>

  45. <td>
  46. TextBox2<br />
  47. <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
  48. </td>

  49. <td>
  50. C1InputNumeric1<br />
  51. <wijmo:C1InputNumeric ID="C1InputNumeric1" runat="server" HideEnter="True" DecimalPlaces="0">
  52. </wijmo:C1InputNumeric>
  53. </td>
  54. </tr>

  55. </table>

  56. <script type="text/javascript">

  57. $('#C1InputText1').focusout(function () {
  58. var str = $(this).val();
  59. var result = str.length;

  60. if (str == "") {
  61. }
  62. else {
  63. str =str + "0"

  64. $("#C1InputText2").val(str);                               //    表面上赋值了,实际上没起作用,离开后值没变
  65. $("#TextBox2").val(str);                                      //   赋值起作用

  66. var txtFirst = $("#C1InputNumeric1");                //   赋值起作用
  67. txtFirst.c1inputnumeric("setValue", str, true);
  68. }
  69. });

  70. $('#TextBox1').focusout(function () {
  71. var str = $(this).val();
  72. var result = str.length;

  73. if (str == "") {
  74. }
  75. else {
  76. str = str+"0"

  77. $("#TextBox2").val(str);
  78. $("#C1InputText2").val(str);

  79. var txtFirst = $("#C1InputNumeric1");
  80. txtFirst.c1inputnumeric("setValue", str, true);
  81. }
  82. });


  83. $("#C1InputText1").hover(
  84. function () {
  85. $(this).addClass('focus');
  86. },
  87. function () {
  88. $(this).removeClass('focus');
  89. });


  90. $("#TextBox1").hover(
  91. function () {
  92. $(this).addClass('focus');
  93. },
  94. function () {
  95. $(this).removeClass('focus');
  96. });

  97. </script>

  98. </form>
  99. </body>
  100. </html>
复制代码
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2015-8-10 17:50:00
5#
回复 4楼drwooh的帖子

谢谢提供的代码,测试后给你反馈。
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2015-8-11 17:43:00
6#
回复 4楼drwooh的帖子

为了实现你的需求,我们建议你使用C1InputText的&quot;text&quot;选项的客户端api。
代码参考:
  1. $(&quot;#C1InputText2&quot;).c1inputtext(&quot;option&quot;, &quot;text&quot;, str);
复制代码

如下附件是参考示例:

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

评分

参与人数 1满意度 +5 收起 理由
drwooh + 5 谢谢,问题解决了.

查看全部评分

请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
drwooh
注册会员   /  发表于:2015-8-12 11:34:00
7#
非常感谢Alice版主,赋值的问题解决了.
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2015-8-12 14:22:00
8#
回复 7楼drwooh的帖子

好的。
谢谢你的反馈。
为了给你提供更优质的服务,请对本次服务进行评分。我们会认真对待你提出的宝贵意见,谢谢        
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部