Feb 19, 2015, 4:11 PM
[CLOSED] Razor formatting and using ui definitions in regular c# code modules
I absolutely despise how razor has issues with huge blocks of Ext.Net nested declarations. It is so confusing that I literally don't want to edit code anymore.
So, I am wondering if there are any recommendations for declaration all the ui in regular c# code modules in static methods like:
Is this viable? Am I missing any functionality like this? This way my formatting will be just the way it normally is inside c# code modules, correct?
One quick thing I noticed is that grid.Layout is a string but in razor you set it to LayoutType.Border. Is there a comprehensive code sample that covers issues like this?
Wouldn't I also be able to more easily reuse code modules by adding an instantiated class as a child to another?
Thanks
So, I am wondering if there are any recommendations for declaration all the ui in regular c# code modules in static methods like:
var grid = new GridPanel();
grid.Region = Region.North;
grid.ID = "JobGrid";
grid.SelectionModel.Add(new RowSelectionModel() { Mode = SelectionMode.Single });
grid.Listeners.BeforeEdit.Fn = "beforeJobEdit";
grid.Title = "Jobs";
grid.Layout = LayoutType.Border.ToString();
and then just do ToScript() in a one liner inside of razor.Is this viable? Am I missing any functionality like this? This way my formatting will be just the way it normally is inside c# code modules, correct?
One quick thing I noticed is that grid.Layout is a string but in razor you set it to LayoutType.Border. Is there a comprehensive code sample that covers issues like this?
Wouldn't I also be able to more easily reuse code modules by adding an instantiated class as a child to another?
Thanks
Last edited by Daniil; Feb 27, 2015 at 1:00 PM.
Reason: Please use [CODE] tags, [CLOSED]