custom html5 buttons are not working

sach215
sach215 edited May 2020 in Kite Publisher
I have added script and api_key properly. when I am clicking on custom buttons, no response I am getting. I tried with dynamic buttons, it's working but I don't need it. I am trying this for web application
  • sach215
    sach215 edited May 2020


    <button data-kite="api_key"
    data-exchange="NSE"
    data-tradingsymbol="RELIANCE"
    data-transaction_type="SELL"
    data-quantity="1"
    data-order_type="LIMIT"
    data-price="100">Buy RELIANCE</button>

  • vishnus
    Hi @sach215

    The code above is working for me:

    <html>
    <head>
    <script src="https://kite.trade/publisher.js?v=3"></script>
    </head>
    <body>
    <button data-kite="api_key"
    data-exchange="NSE"
    data-tradingsymbol="RELIANCE"
    data-transaction_type="SELL"
    data-quantity="1"
    data-order_type="LIMIT"
    data-price="100">Buy RELIANCE</button>
    </body>
    </html>

    Please check if the publisher.js is loaded correctly
  • sach215
    sach215 edited May 2020
    Hi @vishnus ,

    above button is working as expecting. But when I am using this button in angularjs loop (inside ng-repeat) it is not working. please refer below code
     <tr ng-repeat="hld in zerHldCtrl.equityHoldings">
    <td class="row-ht">{{hld.tradingSymbl}}</td>
    <td class="row-ht">{{hld.qnty}}</td>
    <td class="row-ht">{{hld.avgPrice | INR}}</td>
    <td class="row-ht">{{hld.lstPrice | INR}}</td>
    <td class="row-ht">{{hld.currntValue | INR}}</td>
    <td ng-class="{'profit-ht': hld.profit, 'loss-ht': !hld.profit}">{{hld.pnl | INR}}</td>
    <td ng-class="{'profit-ht': hld.profit, 'loss-ht': !hld.profit}">{{hld.netChange}}%</td>

    <td>

    <button data-kite="api_key"
    data-exchange="NSE"
    data-tradingsymbol="RELIANCE"
    data-transaction_type="SELL"
    data-quantity="1"
    data-order_type="LIMIT"
    data-price="100">new1</button>

    </td>
    </tr>
  • vishnus
    Hi @sach215

    Looks like you are not waiting for the publisher.js to be loaded. We tried with a sample angular page and it was working fine.
Sign In or Register to comment.