jQWidgets Forums
jQuery UI Widgets › Forums › Plugins › AngularJS › jqxdocking ng-click event not fired with arguments.
Tagged: angularjs dock, angularjs docking
This topic contains 11 replies, has 2 voices, and was last updated by Peter Stoev 10 years, 7 months ago.
-
Author
-
Please clarify inside jqxdocking ng-click event not fired with arguments, Please provide sample for ng-click event with arguments using jqxdocking and ng-repeat
Hi shan_vs,
The content inside jqxDocking is inside the Scope of jqxDocking which is Isolated Scope. You can’t bind your ng-click to the docking’s scope.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi peter,
I have requirement to extract the data from ng-repeat and and use jqx-button to extract the data inside the jqxdocking. how to do the same.
Thanks
Regards
V Shan
Ok, V Shan or Kavya D or Kavyad23. Please, post your questions from 1 account.
The jqx-data attribute can be used for passing information from outer scope to inner scope.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comvar demoApp = angular.module(“demoApp”, [ “jqwidgets” ]);
demoApp.controller(“demoController”, function($scope) {
$scope.buttons = {
width : 66,
height : 17,
};
$scope.List = [];
$scope.List.push({
ListId : “001”,
PriceLeft : “58.596667”,});
$scope.demoFunction = function(ListId) {
alert(“Demo Fucntion Calling”);
alert(ListId);
};});
</script>
</head>
<body>
<div ng-controller=”demoController”>
<div ng-repeat=”record in List”><jqx-docking jqx-width=”222″ jqx-orientation=”‘horizontal'”
jqx-height=”155″ jqx-mode=”‘default'” id=”docking” jqx-data=”record”
style=”float: left;” class=”dcking”>
<div>Title</div>
<div>
{{ data.ListId }} <br> {{ data.PriceLeft }} <br>
<jqx-button jqx-settings=”buttons”
ng-click=”demoFunction(data.ListId)”>Sell</jqx-button>
</div>
</jqx-docking>
</div>
<jqx-input jqx-width=”200″ jqx-height=”25″ value=’textValue’></jqx-input>
</div></body>
</html>`Here, List is array, I want to pass this Array of Obj “record” in demoFunction() as argument. In that demoFunction, I want to access the value and set that value to TextBox. I tried but the “alert(record.ListId);” is undefined. Why? How to pass arguments in function.
Hi Peter,
Please clarify the above code to acces the data in demofunction.
Thanks
Regards
V Shan
Hi V Shan or Kavya D or Kavyad23,
I think that the Docking’s HTML Structure is Invalid. The Docking requires a DIV tag for Container and then each window should have a DIV tag with two additional nested DIV tags for Title and Content. In addition, each window is with isolated Scope, too. That is because the Window is a widget and as I wrote, each widget is in isolated scope.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hi Peter,
Please Check this above sample code. Here {{data.ListId}} printing the Array values, But If I pass this value to demoFunction(data.ListId), Its printing as [Object Object]. please provide a sample for retriving data from ng-repeat inside docking.
Hi Peter,
Thanks for the help.
Please clarify.
Example :
1) With docking data-ng-click event fired for jqxbutton.
<div ng-controller=”DemoController”>
<div>
<div data-ng-repeat=”record in data” on-render=”jqxButton” id={{record.uniqueNo}}
class=”window ” style=”width: 220px !important; float: left;” >
<div class=”sell”>
<jqx-button jqx-settings=”mrktWtcBtn” data-ng-click=”onSellClick(record);”>Sell</jqx-button>
</div>
</div>
</div>
</div>2) With docking data-ng-click event not fired for jqxbutton.
<div ng-controller=”DemoController”>
<div>
<jqx-docking jqx-width=”‘90%'” jqx-orientation=”‘vertical'”
jqx-mode=”‘docked'” id=”docking” jqx-data=”currencyList”
class=”dcking” style=”float: left; min-height: 452px; !important”>
<div><div data-ng-repeat=”record in data” on-render=”jqxButton” id={{record.uniqueNo}}
class=”window ” style=”width: 220px !important; float: left;” >
<div class=”sell”>
<jqx-button jqx-settings=”mrktWtcBtn” data-ng-click=”onSellClick(record);”>Sell</jqx-button>
</div>
</div>
</div>
</div>
</div>Please provide an sample for using docking with ng-repeat and access using jqxbutton.
Thanks for your help
Regards
V Shan
Hi Peter,
Please let us know, why data-ng-click event not fired inside of docking.
Please help
Thanks
Regards
V Shan
Hi Peter,
Please provide solution to implemented shared scope between jqwidgets components (JQXDOCKING,JQXTAB,JQXWINDOW) and angular.
Thanks
Regards
V Shan
Hi V Shan,
Using the learning resources which you have, I would suggest you to think about a solution on your own. We can help with advice, but our job is not to implement tasks instead of you. In the current code, I think that it is not possible to pass information through ng-click. I think you should use additional attributes.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.