Any more developments on this script?
I am trying to create a general wrapper that would accept controls that are not Infragistics as editors and failing miserably :)
Thank you for replying. The problem is that our client wants exactly this kind of behavior ( we presented a solution with something similar to the RowEditTemplate and it wasn't satisfactory). I've debuged your javascript code and I think I found a solution. Still have a problem with the add row functionality but i'm investigationg this also and try to come with a solution.
Here is how I've done it, just in case someone else looks for it:
In the server side control use ClientScript to register your js file and to run a startup script that will initialize the client side behavior object.
Something in the lines of : var x = new SearchControl(id);
The client side object ( is not fully implemented just a proof of concept to see that it works):
function SearchControl(id){ this.ID = this.Id = id; this.Element = document.getElementById(this.Id); this.ClientUniqueId = this.Id; this.getVisible=function(){return (this.Element.style.display!="none"&&this.Element.style.visibility!="hidden");} this.setVisible=function(show,left,top,width,height) { this.Element.style.display = show ? 'block' : 'none'; if (show) { this.Element.style.position = 'absolute'; this.Element.style.width = width; this.Element.style.height = height; this.Element.style.top = top; this.Element.style.left = left; } } this.setValue=function(date,fireEvent) { alert('setValue'); } this.getValue=function(){ return 'somevalue'; } this.handlers = new Array(); this.addEventListener=function(name,fref,obj) { var a=this.handlers[name=name.toLowerCase()]; if(a==null)this.handlers[name]=a=new Array(); var eh=a[a.length]=new Object();eh.handler=fref;eh.obj=obj; } this.removeEventListener=function(name,fref,obj) { name=name.toLowerCase(); if(this.handlers==null)return; if(this.handlers[name]==null||!(this.handlers[name].length))return; for(i=0;i<this.handlers[name].length;i++) { var listener=this.handlers[name][i]; if(listener!=null)if(listener.handler==fref)this.handlers[name][i]=null; } } this.Element.Object = this; }
The UniqueID implementation of the IProvidesEmbeddableEditor must actually return the ClientID of the control.
This one could be very trciky, I am just going through the source code and indeed you are correct that currently there is not a good guide that helps you to get started. I will do my best to have this published somewhere but it will take time.
Meanwhile, is it possible for you to use RowEditTemplate instead? You can customize the HTML of the row and use custom editors inside, I hope that this is possible in your scenario.