3.0.4

V2.55 equivalent to V1 templates

I have searched high and low for this and cannot seem to find quality information - and my trial and error is getting me nowhere very slowly.

In a V1 implementation of the grid we made extensive use of templates to create cell editors and very complex displays within cells.

Need to migrate to 2.55 for obvious reasons, but need to recreate these templates in the new syntax.

Goals for a template (Input as an example):
1. operate similar to existing grid input (click to edit, highlight text when switching to edit mode
2. at the end of editing, check length of input against a max length and trim extra characters
3. the template should start out as text and switch to the input box - instead of showing the input box the whole time. After editing complete switch back to text.

What is the new syntax for creating it like this:
// **************************************************
//     Input Cell Template. 
// **************************************************
    My.Templates.Input = AW.Templates.Text.subclass();
    My.Templates.Input.create = function(){
    	    var obj = this.prototype;

    };


I prefer to figure out how to properly use these templates instead of creating inline code on the pages where i define the actual grids, because they can become very bloated. If this is a separate file then it helps with performance.

Thanks in advance.
Ben W (ScheduleForce)
December 8,
OK - so no one does subclassing anymore? What is the new approach?
Ben W (ScheduleForce)
December 9,
Ben,
It is ( a bit more complex than ver 1.x) possible, but require more testing, there are several samples/ways to do it, here are some:
( or just search for 'subclass' , 'settag' , 'template' .. and so on)

http://www.activewidgets.com/javascript.forum.18592.9/dynamic-url-image-in-ver.html
http://www.activewidgets.com/javascript.forum.13008.4/complex-html-form-in-a.html
http://www.activewidgets.com/javascript.forum.9861.5/how-to-add-an-html.html
http://www.activewidgets.com/javascript.forum.13178.4/suggestion-for-feature-cell-marker.html
http://www.activewidgets.com/javascript.forum.12038.19/expanding-collapsing-a-row-experiment.html
http://www.activewidgets.com/javascript.forum.10638.7/custom-control-question.html
http://www.activewidgets.com/javascript.forum.7839.2/trouble-creating-compound-controls.html
http://www.activewidgets.com/javascript.forum.9924.11/any-documentation.html
http://www.activewidgets.com/javascript.forum.17790.0/aw-templates-textarea-let-s.html
http://www.activewidgets.com/javascript.forum.19672.3/any-workaround-for-the-removed.html
C++
December 10,
But maybe , as you describe it would be much simpler (if just an input-editable template needed), use:
obj.setCellEditable(true);
obj.onCellValidated(....
or
obj.onCellEditEnded(....
C++
December 10,
http://www.activewidgets.com/javascript.forum.23382.9/is-there-a-way-of.html
http://www.activewidgets.com/javascript.forum.13440.3/accessing-old-value.html
http://www.activewidgets.com/javascript.forum.15772.8/how-can-i-allow-only.html
C++
December 10,
The challenge here seems to be that as soon as you create your template, it replaces the always visible/default template and the editor is displayed all the time.

I feel this to be an unprofessional/hard to read view - and would be much better if your editor is displayed only when you are working on that cell.

After more playing around the default editor for basic inputs is fine - but for drop-downs/combo etc - i havent found a solution yet.

Ben W (ScheduleForce)
December 20,

This topic is archived.

See also:


Back to support forum