I am using a webgrid with RowEditTemplate as follows
<ClientBindings> <ig:RowEditingClientBinding ColumnKey="DataConteúdo" ControlID="WebDatePickerDataConteudo" GetValueJavaScript="$get({ClientID}).value" SetValueJavaScript="$get({ClientID}).value={value}" /> <ig:RowEditingClientBinding ColumnKey="ConteúdoDesenvolvido" ControlID="controlConteudo" GetValueJavaScript="$get({ClientID}).value" SetValueJavaScript="$get({ClientID}).value={value}"/> </ClientBindings>
<RowEditingClientEvents TemplateClosing="onTemplateClosing" />
I am using a javascript function as follows I have found in the forum
function onTemplateClosing(sender, args) { var ret = sender.get_behaviors().get_editingCore().get_behaviors().get_rowEditingTemplate(); var colKey = "DataConteúdo"; var binding = ret._bindings._getObjectByAdr(colKey); var datePicker = $find(binding.get_clientID()); var dateVal = datePicker.get_value(); }
It's not setting the Date column in the WebGrid with the DatePicker value! Can you please tell me what is going wrong?
Can you provide me a javascript function to get the Date field in the grid and set the DatePicker in the RowEditTemplate?
I have search the forum and the web and I think that you could provide this as a sample. I think that using RowEditTemplate is very good with IG controls!!
Thanks in advance!
Edson
Hello Edson,
Thank you for contacting Infragistics!
I have a few follow up questions concerning this matter. What version of NetAdvantage are you using? What service release are you using? Do you see this in multiple browsers or just one? If so what version of the browser?
Looking forward to hearing from you.
Mike,
Thank you for your reply.
IG: Infragistics4.Web.v12.2, Version=12.2.20122.2054 downloaded a month ago for trial.
Browsers: Chrome Versão 25.0.1364.152 m and IE 9.0.8112.16421 -
OS: Windows 7
Note that I have sent you just the javascript function that get the Template values and set the Grid values.
I need also a funtion that get the Grid values and set the Template values.
If I use regular text controls on the template, it works fine, but when I use IG DatePicker I can't set its value based on the Grid value using the default Get Set for text controls. The same occurs when I try to update the Grid value with the DatePicker template value.
Can you provide me me a simple sample with these behaviors?
Thanks
Hi Mike,
As for SetValueJavaScript method, I am not sure how to set this value to empty string instead of current date. In Chrome Developer Tool, I placed a breakpoint on the default value that was current date as always when I click on a new row button.
Do you have any idea how to set this value to empty string?
This seems to trigger a change in the grid although the dates are the same.
Thank you for the update. I have done some further looking into this matter and have found how you can use the WebDatePicker in the RowEditTemplate. To do so you will want to change the RowEditingCleintBinding for the WebDatePicker to the following:
GetValueJavaScript="$find({ClientID}).get_value()" SetValueJavaScript="$find({ClientID}).set_value({value})" />
I am also attaching a sample demonstrating this behavior. Please note I removed the ig_res folder to upload this to the forum.
Please let me know if you have any further questions concerning this matter.