This is a migrated thread and some comments may be shown as answers.

How to initialize many kendoUI widgets without the browser displaying core html

1 Answer 205 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Grant asked on 06 Jan 2017, 07:36 AM

Hi, 

What is the best way to go about initializing many kendoUI widgets on a single page without the browser flashing the code html before rendering the widget?

Below is a simplification of my page structure.

thanks in advance,
Grant

<html>
    <head>
        <!-- Script imports -->
        <script type="text/javascript">
            $(function() {
                //1. Initialize Grid DataSource
                //2. Initialize Grid
                //3. Initialize view Window
                //4. Initialize form Window
                //5. Initialize 3-4 buttons
                //6/ Initialize kendo validator
            });
        </script>
    </head>
 
    <body>
        <div id="grid"></div>
 
        <div id="window-view"></div>
        <div id="window-form"></div>
    </body>
</html>

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 09 Jan 2017, 02:58 PM

Hi Grant,

It is expected that unstyled HTML may be shown while stylesheets and scripts are being downloaded and while widgets are initializing.

Perhaps you can consider adding some overlay div element in the page markup (perhaps with inilne styles) that will hide the page until everything is done.

Then, adding stylesheets first, then scripts, and initializing Kendo widgets in $(document).ready should provide the shortest time to having fully styled widgets on the page.

Another option is to hide all the content, initialize the widgets in invisible containers and then call their resize() method. Note, that this may lead to some issues and I would not recommend this in general: http://docs.telerik.com/kendo-ui/troubleshoot/troubleshooting-common-issues#incorrect-appearance-or-errors-occur-in-hidden-widgets.

Regards,

Marin Bratanov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Answers by
Marin Bratanov
Telerik team
Share this question
or