-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{dataKey} never worked in otherActionButtons #1038
Comments
You can try to access it via |
I just tried $btn.attr('data-key') but it still returns the same empty value data-key= |
Yes it seems a problem with your calling this code even before the DOM element is initialized... you need to call this code on Will check if I can enhance this behavior a bit to allow developers to configure a callback for this in an easier way. |
I solved the problem! if I use data-key="{dataKey}" var btns = '<button type="button" class="kv-cust-btn btn btn-xs btn-default" title="Download" data-key="{dataKey}">' +
'<i class="glyphicon glyphicon-download"></i>' +
'</button>'; Then I get a very strange attribute code: var btns = '<button type="button" class="kv-cust-btn btn btn-xs btn-default" title="Download" {dataKey}>' +
'<i class="glyphicon glyphicon-download"></i>' +
'</button>'; Then it renders the correct html attribute code: So the example code on the doc page is misleading: Or you may need to change the original codes. |
Will correct the docs. |
I noticed that the doc got updated, the texts after the template section all appear to be red (after the datakey part). Perhaps you forgot to add a closed tag somewhere. It's a small thing, but kind of annoying when reading the doc. |
Fixed. |
Great! Thank you! |
I am trying to create a download button also. So I added the following to my config
The dataKey is replaced as expected |
@CrestApps : You can look my very first post and the very last few lines. You can pass your url into your scripts with the key. Ex: window.location = 'http://...donwload_url_here.../'+key; to initiate the download. This is just one of the possible ways of doing it. |
I had been stuck with this problem for months and still can't solve the problem.
I followed the example on the doc page. My codes:
And I always get:
data-key=
Is this a bug or something I did wrong?
The text was updated successfully, but these errors were encountered: