FineUI 官方论坛

标题: 『可编辑表格』在AfterEdit事件中,如何消除红色提示图标? [打印本页]

作者: dusdong    时间: 2014-4-30 06:49
标题: 『可编辑表格』在AfterEdit事件中,如何消除红色提示图标?
本帖最后由 dusdong 于 2014-4-30 07:30 编辑

在例子 http://fineui.com/demo/#/demo/gr ... cell_afteredit.aspx 中,是使用 Grid1.DataBind() 重新加载整个Grid,红色标记自然就取消了。
但这样做太耗费资源了。

我查到了函数 CommitChanges(),但会报错。

  1. var f0=F('RegionPanel1_RegionLeft_treeCategory'),f1=F('RegionPanel1_RegionRight_GridProduct'),f2=F('RegionPanel1_RegionRight_GridProduct_ctl07_tbxEditorQuantity');F.state(f0,{"F_Nodes":[["产品类别",0,"0",1,0,0,1,"","","","","","","","",1,0,"","",[["蔬菜",1,"21",1,0,0,0,"","","","","","","","",1,0,"","",[]],["Computers",0,"2",1,0,0,0,"","","","","","","","",1,0,"","",[["Desktops",1,"3",1,0,0,0,"","","","","","","","",1,0,"","",[]],["Notebooks",1,"4",1,0,0,0,"","","","","","","","",1,0,"","",[]],["Accessories",1,"5",1,0,0,0,"","","","","","","","",1,0,"","",[]],["Games",1,"7",1,0,0,0,"","","","","","","","",1,0,"","",[]],["Software",1,"6",1,0,0,0,"","","","","","","","",1,0,"","",[]]]],["Electronics",0,"8",1,0,0,0,"","","","","","","","",1,0,"","",[["Camera, 。。。
  2. ……
  3. ……
  4. []]]]],"F_Nodes_GZ":"H4sIAAAAAAAEAO2Uv07DMBDGXyW6gSlDUv6PVYoqMbB0tDqY1CVW3VzkGEWMbGwMMLIzwMIKr0NFH4PEdhcEpc58UpRYib7Pd+cvP8bg8/159XD79faxunuBOIkhgThtn0l7B/j96r67FWOwfnxd3z91L2GQbrTJLtrpNGaQ4bK6NkLXdvNBkAGDkagXBqvabr8fvvsFGnGJuHAGB+EGwzwXdY1aCmdxGG4x5ksvPg4XT3BuGq6F1R8F6q3DmRK50VjK3B3BSeARZG35msdRVaBBW8ZpjxQIpTqH0k8iTfq0MqyqdhQq2osmBQrXThqWyXaihdTGVxEWR1vDueClV/fIo6+7U/cJo++f/whlGppK6zaSV9JwFc2wKRXymfcKDZmdSSOUvnH6HiEfy7mJMq43JYRF1LfzN+h2DAaBjkBHoAMC3baZEOgIdAQ6Ah0Q6Lb+IQQ6Ah2BjkBHoPuvnek3Nww3vaUTAAA="});f0.f_loadData();f0.f_selectNodes();F.state(f1,{"F_Rows":{"Values":[["","","<img src="http://localhost:2840/content/images/thumbs/0000033_best-grilling-recipes_75.jpeg" class="f-grid-imagefield" style="width:75px;height:75px;"/>","Best Grilling Recipes","More Than 100 Regional Favorites Tested and Perfected for the Outdoor Cook (Hardcover)","","27.00","3","<a data-qtip="选配该商品" href="javascript:;" onclick="javascript:F('winAdd').f_show('/peisong/shoppingcart/AddToCart.aspx?id=13','选配');"><img src="/icon/add.png" data-qtip="选配该商品" /></a>","<a data-qtip="删除" href="javascript:;"
  5. ,"HP Pavilion Artist Edition DV2890NR 14.1-inch Laptop","Unique Asian-influenced HP imprint wraps the laptop both inside and out","","1,590.00","","<a data-qtip="选配该商品" href="javascript:;" onclick="javascript:F('winAdd').f_show('/peisong/shoppingcart/AddToCart.aspx?id=31','选配');"><img src="/icon/add.png" data-qtip="选配该商品" /></a>","<a data-qtip="删除"
  6. …………
  7. href="javascript:;" onclick="F.confirm('_top','','确定删除该行商品吗?','__doPostBack(\\'RegionPanel1$RegionRight$GridProduct\\',\\'Command$19$9$Delete$\\');');"><img src="/icon/delete.png" data-qtip="删除" /></a>"]],"DataKeys":[[13,"Best Grilling Recipes"],[18,"Canon Digital SLR Camera - Black"],[19,"Canon Digital SLR Camera - Silver"],[22,"Cooking for Two"],[27,"EatingWell in Season"],[45,"The Best Skillet Recipes"],[10,"Arrow Men's Wrinkle Free Pinpoint Solid Long Sleeve"],[10,"Arrow Men's Wrinkle Free Pinpoint Solid Long Sleeve"],[16,"Build your own computer"],[24,"Custom T-Shirt"],[30,"HP IQ506 TouchSmart Desktop PC"],[32,"HP Pavilion Elite M9150F Desktop PC"],[60,"大白菜"],[61,"小油菜"],[63,"油麦菜"],[11,"ASUS Eee PC 1000HA 10-Inch Netbook"],[12,"ASUS Eee PC 900HA 8.9-Inch Netbook Black"],[17,"Canon Digital SLR Camera"],[20,"Canon VIXIA HF100 Camcorder"],[31,"HP Pavilion Artist Edition DV2890NR 14.1-inch Laptop"]],"States":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},"F_Rows_GZ":"H4sIAAAAAAAEAO2cbW/byBGA/8rANdoEECWSenfuUtiyHRuNE8fyxS3OgbAiV+JG5C7DXUpWigOuH1q0QIsr0DdcUaA9IG2BorgW/dQW7b+p75JP/QudJWlHhs85V5YODMBACCnucmd3OY93Znao7648Jn5M5cra+++vrJT05x0WDEFGzrvHK55S4Vql4guH+J6Qas1u1cyKI7iiXFVYQIZUVpQXB31ZMfW/arXXp1IZw4j5PuNDI6IOC6nsNevlpyEdHq+A4xMpse2BruQaSSMDRn0Xy6Sa+hTLJsxV3lqzHp7c8Sgbeio9P16p3MUObqAEuJdJgINUAl7fExGFQ49wsEwTrw+Z4MSHbTIWEVNUwiHeSF0g3IV9Gg2oo78NRATKo/AwVq7A844QI7i1QyLXEWMa3U4nxW6WTROPVT1BBFyiiPFMsRA7++rDH736/k9e/uX3p7/4wenPvofDAC+iAyx5SsZEOhEL1Rr2HQR3fOaMLhZs3/r616rtOxPG1103Ob1dHvSkJyZpQSWkTAo+rOClMMQBOyRSFax7KDp4ViYyPPkmc9+1qkn1UvJ/2qW0NZR8d+aRVhg+vgpx3XLI9eP4sqFU7r5TIXcvj/r0h7979fGL6wx2u4wSBywK0gH1lAhnujpz+vknn55++uu0YezDy09+nHbj9Ke/+u+/fjtTsddzxT6q4wZxRreOj5Nr6ePeJ5z61mr65UBrzioqirsfCTd2VFa1lB07IghQF1bN1fbqJvWpoqtZye07b5g7N6n6RdP3ek6yWXtSWgRUNavnEC644bIhU8Q3pB8ZDgloRIy+j3OwULo6W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6/tkvX7zWdbuWc123Cl2fV9eXvoG/GF1vLlLXUdFf/fMPl3S9qhW8aeZc14vs4Ll1fenb8A+Eojq548YRW6tHZCwNSik6FoaFlzyCB4NxxzM4VVrIQk2d9e57XdjSuxodnXNv7qzjwdhFcfAgFadDb3FII9iZ9lEIbPGhdjnEYEAjCQQcTzBHfwesNBARTjl+1XvwoZjgbThcGQdh4j0Ews2SySiRUyDu01iqACcDG3LQtXC1x6EEjEnERCyBU+pm3oZdapxFj2t5T8wslqW5UV36DvzCULUvoNpOSG21L5C6hNz+WV7bCa6tcvsCr+c5/jt4s87SpK4OOnPqKDZmagrrfDrxaERTd/+IGdsMWqZdtqx+ZVg+8+3rud+rKbz6uSlb+q5+mltfgtATStyUtPaVLwp8JW8IaBzssm0EdEhCdqJjaHsPuyAp15Ezh4QqjnBVo1zECJxLFWF+ssaFODoaGZI9p9lMGM9i4msGw4hxla1s52/h5Ja0IgF0btKWniuwSNJq1Yy0MTthxPAGaBFq0rRltpTXcR7vfnt3HXa29duenTM5CW8nINBkxI7DcyGCO5CYoAeEDyk8zAp2tVToKtJnPiKWvcBTr+acJrsI0M1N09KTDBZlHdYbF3aO8PkzqQzqMu0GGe7YbrVNHhlWzUoNRh9XEREubSdpPZEPW6l82Hys5T84AKtWTjsA95MO4G3vcfYsprAuGeFYNPBjiv6cC9gcC5JlCyYRCdNs7bTb0BdoSDIumZs6fiI+T/mpt3OOY7Vw1ubGcYk5Dk9KK5tY4Vt0mvywgVW96kcDEFyrdY13nnW99nVeA8WKtn35HTl9uXnFOz9YVqu/4S0HLducySr9xvUzSm94a+Pq9Dw9oNqlnCW8WjW/NE9D17Kvt1mNVRvm7JaavmDN7jvoC9XZ4KzuuHWt0JSuaf8fTrGu33yDpa/nxHyzcaKHbs3511VrNdorKv2xDmxpzs+TD/4HPiOLA/VDAAA=","SelectedCell":[2,6]});F.state(f2,{"Text":"2","Text_GZ":""});F('RegionPanel1_RegionRight_GridProduct').f_commitChanges();
复制代码


我该肿么办?



作者: 黑冰.cn    时间: 2014-4-30 08:40
重新绑定比你用JS去消除更省资源。
作者: dusdong    时间: 2014-4-30 08:43
本帖最后由 dusdong 于 2014-4-30 08:45 编辑
黑冰.cn 发表于 2014-4-30 08:40
重新绑定比你用JS去消除更省资源。

重新绑定需要重新读取数据库数据库;但如果用JS语句消除红色提示的话,只在客户端触发吧?

并且重新绑定的话,滚动条位置就变了,用户体验很差啊!

作者: Evanyi    时间: 2014-4-30 20:39
dusdong 发表于 2014-4-30 08:43
重新绑定需要重新读取数据库数据库;但如果用JS语句消除红色提示的话,只在客户端触发吧?

并且重新绑定 ...

重写CSS或者把那图片换成空白即可。
作者: dusdong    时间: 2014-5-2 08:43
暂时还是用重新绑定吧。 不过 CommitChanges() 不应该报错哦,应该是个Bug吧?




欢迎光临 FineUI 官方论坛 (https://fineui.com/BBS/) Powered by Discuz! X3.4