difference between data-show and data-init

7 posts, 0 answers
  1. Justin
    Justin avatar
    3 posts
    Member since:
    Jun 2010

    Posted 29 May 2012 Link to this post

    what is the difference between data-show and data-init?  and when should you use each one?
  2. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2895 posts

    Posted 30 May 2012 Link to this post

    Hi Justin,

    The data-init will fire once, after the view and its child widgets are initialized, while the data-show will fire every time when the view becomes visible.
    The init event is suitable for actions that should be done only once, right after the initialization of the view (for example - creating a widget). The show event is appropriate for a code that you want to be executed after each show of the view.
    For convenience I prepared a small example that shows the event usage in action.

    Greetings,
    Alexander Valchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Justin
    Justin avatar
    3 posts
    Member since:
    Jun 2010

    Posted 30 May 2012 Link to this post

    Thanks for the reply,

    my question was in response to not having access to the e.view.params from the data-init event while i do have access to e.view.params from from the data-show event.  Is this the correct behavior?
  4. Petyo
    Admin
    Petyo avatar
    2444 posts

    Posted 31 May 2012 Link to this post

    Hi,

    Yes, this is the expected behavior, as described in our documentation

    Kind regards,
    Petyo
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  5. Abdul Hannan
    Abdul Hannan avatar
    5 posts
    Member since:
    Jun 2013

    Posted 11 Dec 2013 Link to this post

    Note that data-show executes every time you call alert( ) , Phonegap's notification.confirm ( ) and notification.alert ( ) on a mobile device. This is a very strange behaviour
  6. Petyo
    Admin
    Petyo avatar
    2444 posts

    Posted 11 Dec 2013 Link to this post

    Hello Abdul,

    Indeed it is - we have not received reports of such behavior so far. Is it possible for you to open a ticket with a a sample that reproduces it? We will take a look. 

    Regards,
    Petyo
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  7. Abdul Hannan
    Abdul Hannan avatar
    5 posts
    Member since:
    Jun 2013

    Posted 12 Dec 2013 Link to this post

    Yes Petyo, I have raised this issue via Telerik Support. Please Search for "Method Bonded with data-show executes every time alert ( ) function is called " and you will find the code to reproduce the problem,
    Thanks 
Back to Top