zoukankan      html  css  js  c++  java
  • ComponentArt Grid 行部分字段Insert操作

    第一次写博客,水平可能有限,希望大家提出宝贵的改进意见

    主要介绍下,在ComponentArt中,对于Insert操作,要先设置下AutoCallBackOnInsert="true",然后写上:
    <ClientTemplates>
                    
    <ComponentArt:ClientTemplate ID="InsertCommandTemplate" runat="server">
                        
    <href="javascript:insertRow();">Insert</a> | <href="javascript:Grid1.EditCancel();">Cancel</a>
                    
    </ComponentArt:ClientTemplate>
     
    </ClientTemplates>

    在insertRow()这个脚本中写上:
    function insertRow()
    {
        Grid1.EditComplete(); 
    }
    这个时候,点击Insert,然后获取值后,就可以将数据插入到数据库中了。

    这类Insert操作只是很简单和比较常见的,将所有列的值都从Grid中获取到即可,想了解详细的,请参考ComponentArt的live_example 或者:http://www.componentart.com,这里都有详细的介绍

    我想说的是,如果并不是每列都作为要插入的字段的话,那么,这样设置是不会执行服务器端的ComponentArt.Web.UI.Grid.GridItemEventHandler 这个委托事件的

    所以,如果要想引发该委托事件,则必须将脚本insertRow()写为:
    function insertRow()
    {
        Grid1.EditingDirty 
    = true;
        Grid1.EditComplete(); 
    }
    这样就可以了

    呵呵,如有说的不对的地方,请大家批评,我会改正,谢谢
  • 相关阅读:
    营销运营中会遇到的名词及解释
    常用excel函数公式及操作示例
    opensuse安装pycharm
    Atom 基础使用
    git使用
    初学Python(第一课)
    django新手第一课
    浅谈session,cookie,sessionStorage,localStorage的区别及应用场景
    事件冒泡的应用
    django站点管理
  • 原文地址:https://www.cnblogs.com/lizheng114/p/1245555.html
Copyright © 2011-2022 走看看