jQuery UI Widgets Forums Plugins AngularJS retrieving scope from an event object using jqxExpander

This topic contains 6 replies, has 2 voices, and was last updated by  fritzfrancis 4 years, 4 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author

  • fritzfrancis
    Participant

    Hello Peter,

    I have the following directive in my markup.

    <jqx-expander data-ng-repeat=”locationType in system.LocationTypes” jqx-on-expanding=”OnLocationTypeExpanding(event)”>

    And I have the following controller.

    module.controller
    (
    “PageController”,
    function ($scope)
    {
    $scope.OnLocationTypeExpanding = function(event)
    {
    var obj = $(this).scope(); // This line does not work.
    }
    }
    );

    How do I retrieve my locationType object from the event object in my event handler?

    Regards,

    Fritz


    fritzfrancis
    Participant

    Hello Peter,

    One way that I have found is to use modify my markup to be

    <jqx-expander data-ng-repeat=”locationType in system.LocationTypes” data={{ locationType }}” jqx-on-expanding=”OnLocationTypeExpanding(event)”>

    And then in my controller method I can access event.data. Is that the correct way to handle this?

    Regards,

    Fritz


    fritzfrancis
    Participant

    Hello Peter,

    I see that the event.data comes over as a string, so I have to JSON.parse() it back into an object. That’s seems like a code smell to me. Why does the jQuery extension method .scope() does not work? It would be nicer if I could just invoke $(event.target).scope() or $(this).scope() to get back the bound object.

    Regards,

    Fritz


    fritzfrancis
    Participant

    Hello Peter,

    I was wrong. My solution did not work. The data attribute creates a copy of the object and does not provide me with the object in scope. Can you provide me with a correct solution?

    Regards,

    Fritz


    fritzfrancis
    Participant

    Hello Peter,

    Am I not up-to-date on my licensing? I thought I would have the Standard Support of 48 hours. I guess I also need to clarify what “48 hours” mean. Does “48 hours” assume the day to be 24 hour-day or am 8-hour work day? I absolutely love your products, it is cost effective and relatively well documented, I would hate to have use Telerik or SyncFusion just because of lack of support. Do you separate support plans that I could pay separately for that ensures quicker response times?

    Regards,

    Fritz


    Peter Stoev
    Keymaster

    Hi Fritz,

    Support is provided by email. If you are licensed user with valid subscription( I do not know whether you are from your nickname), I suggest you to write to support@jqwidgets.com which is the Support email as written everywhere on our website. This is Community Forum where everyone writes and is free to write. We support the Forum from time to time, but there is no time-frame in which we have to reply in a forum and there is no obligation whether we need to reply here. In the Forum, you should expect replies only from your Forum peers. Regarding your question: you bind to an even in the scope so you have access to the scope in the event handler through the scope variable.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    fritzfrancis
    Participant

    Thanks Peter,

    For some reason I thought the forum and the support was the same thing. I will send my questions there from now on.

    Regards,

    Fritz

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.