账号通
    

账号  

密码  

2123

查看

3

回复
主题:[讨论]关于自定义字段类型的修改或增加 [收藏主题] 转到:  
chuangsjh 当前离线

137

主题

1

广播

0

粉丝
添加关注
级别:一年级

用户积分:987 分
登录次数:184 次
注册时间:2006/8/18
最后登录:2015/5/4
chuangsjh 发表于:2011/9/30 19:25:55   | 只看该作者 查看该作者主题 楼主 
科汛智能建站系统

在我们自定义模型的时候 由于站的需要 需要的字段类型 官方目前不能满足  



那么能否修改或增加新的字段类型呢?例如把下面的效果 做成一个字段类型

  1. <html>
  2. <head>
  3. <title>jQuery表格操作添加行、删除行和动态移动丨芯晴网页特效丨CsrCode.Cn</title>
  4. <script language="javascript" src="http://yuanhs1982.blog.163.com/blog/jquery.js"></script>
  5. </head>
  6. <body>
  7. <a href="http://yuanhs1982.blog.163.com/blog/#" onclick="add_line();">添加一行</a>  <a href="http://yuanhs1982.blog.163.com/blog/#" onclick="remove_line
  8. ();">删除一行</a>  <a href="http://yuanhs1982.blog.163.com/blog/#" onclick="up_exchange_line();">上移
  9. </a>  <a href="http://yuanhs1982.blog.163.com/blog/#" onclick="down_exchange_line();">下移</a>
  10. <table>
  11. <tr><td>序号</td><td>步骤名称</td><td>步骤描述</td><td>相关操作</td></tr>
  12. </table>
  13. <table id="content">
  14. </table>
  15. <script language="javascript">
  16. var currentStep=0;
  17. var max_line_num=0;
  18. function add_line(){
  19. max_line_num=$("#content tr:last-child").children("td").html();
  20. if(max_line_num==null) {
  21. max_line_num=1;
  22. }
  23. else{
  24. max_line_num=parseInt(max_line_num);
  25. max_line_num+=1;
  26. }
  27. $('#content').append("<tr id='line"+max_line_num+"' onclick='lineclick
  28. (this);'><td>"+max_line_num+"</td><td>打开网页"+max_line_num+"</td><td>打开登录网
  29. 页"+max_line_num+"</td><td>删除  编辑</td></tr>");
  30. }
  31. function remove_line(){
  32. $("#content tr").each(
  33. function(){
  34. var seq=parseInt($(this).children("td").html());
  35. if(seq==currentStep) $(this).remove();
  36. if(seq>currentStep) $(this).children("td").each(function(i){if(i==0)$(this).html(seq-
  37. 1);});
  38. }
  39. );
  40. currentStep=0;
  41. }
  42. function up_exchange_line(){
  43. if(currentStep==0){
  44. alert('请选择一项!');
  45. return false;
  46. }
  47. if(currentStep<=1){
  48. alert('非法操作!');
  49. return false;
  50. }
  51. var upStep=currentStep-1;
  52. //修改序号
  53. $('#line'+upStep+" td:first-child").html(currentStep);
  54. $('#line'+currentStep+" td:first-child").html(upStep);
  55. //取得两行的内容
  56. var upContent=$('#line'+upStep).html();
  57. var currentContent=$('#line'+currentStep).html();
  58. $('#line'+upStep).html(currentContent);
  59. //交换当前行与上一行内容
  60. $('#line'+currentStep).html(upContent);
  61. $('#content tr').each(function(){$(this).css("background-color","#ffffff");});
  62. $('#line'+upStep).css("background-color","yellow");
  63. currentStep=upStep;
  64. }
  65. function down_exchange_line(){
  66. if(currentStep==0){
  67. alert('请选择一项!');
  68. return false;
  69. }
  70. if(currentStep>=max_line_num){
  71. alert('非法操作!');
  72. return false;
  73. }
  74. var nextStep=parseInt(currentStep)+1;
  75. //修改序号
  76. $('#line'+nextStep+" td:first-child").html(currentStep);
  77. $('#line'+currentStep+" td:first-child").html(nextStep);
  78. //取得两行的内容
  79. var nextContent=$('#line'+nextStep).html();
  80. var currentContent=$('#line'+currentStep).html();
  81. $('#line'+nextStep).html(currentContent);
  82. //交换当前行与上一行内容
  83. $('#line'+currentStep).html(nextContent);
  84. $('#content tr').each(function(){$(this).css("background-color","#ffffff");});
  85. $('#line'+nextStep).css("background-color","yellow");
  86. currentStep=nextStep;
  87. }
  88. function lineclick(line){
  89. $('#content tr').each(function(){$(this).css("background-color","#ffffff");});
  90. var seq=$(line).children("td").html();
  91. $(line).css("background-color","yellow");
  92. currentStep=seq;
  93. }
  94. </script>
  95. </body>
  96. </html>

 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
quietlya 当前离线

1405

主题

0

广播

0

粉丝
添加关注
级别:九年级

用户积分:1287 分
登录次数:155 次
注册时间:2011/7/31
最后登录:2012/4/20
quietlya 发表于:2011/9/30 19:48:57   | 只看该作者 查看该作者主题 沙发 
科汛智能建站系统
不错哈~~~~~~~~~~~~关注了
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
dentalhealth 当前离线

41

主题

0

广播

0

粉丝
添加关注
级别:学前班

用户积分:512 分
登录次数:62 次
注册时间:2006/11/10
最后登录:2019/12/28
dentalhealth 发表于:2011/9/30 21:37:52   | 只看该作者 查看该作者主题 藤椅 
科汛在线网校系统
什么意思?现在科讯非常个性化的,一般的都可以用。必要时还可通过自定义模型,或者自定义表格及数据库来完成。
 
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
fuguojian 当前离线

1070

主题

3

广播

1

粉丝
添加关注
级别:八年级

用户积分:2178 分
登录次数:112 次
注册时间:2009/2/16
最后登录:2019/6/28
fuguojian 发表于:2011/9/30 23:44:38   | 只看该作者 查看该作者主题 板凳 
科汛智能建站系统
没看懂代码的意思,呼呼
 
简直太疯狂了: http:&#47;&#47;6438990.taobao.com&#47;, 简直太疯狂了: http:&#47;&#47;6438990.taobao.com&#47;
  支持(0) | 反对(0) 回到顶部顶端 回到底部底部
<上一主题 | 下一主题 >
Powered By KesionCMS Version X1
厦门科汛软件有限公司 © 2006-2016 页面执行0.12305秒 powered by KesionCMS 9.0