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
Custom variable support for templates #149
Comments
Have you tried configuring $("#input").fileinput({
otherActionButtons: '<button class="btn btn-sm btn-edit" data-key="{dataKey}">' +
'<i class="glyphicon glyphicon-edit"></i></button>'
});
// then you can write a code on click of the btn-edit as below
// build your loop for this below correctly - just an example
$(".btn-edit").on("click", function() {
var key = $(this).data('key');
// you can use the key in your ajax actions or using data-key
// trace back to the preview container DOM and its children
}); |
Sorry, but that is not what I want. I've combined the Fileinput-Widget with your Sortable-Widget, now to send the sort-positions I need the ID's of every file. The other use is to set the value of the description of every file in the description-input. |
Was suggesting an alternative of using buttons in each thumbnail to achieve use cases similar to yours... (for example button to reorder files -- or rename files through a popup or embedded input.). Anyway, I will need to think about your ask in detail. An option you also have is to use data attributes in element(s) on the page to store info from various plugin events and reuse them the way you want. |
Resolved via upgrade to release v4.1.7. Two new properties
For example: // example 1 - tags with value set as string
customLayoutTags: {
'{tagA}': '<span class="label label-default">Tag A</span>',
'{tagB}': 'Tag B',
}
// example 2 - tags with value set as callback
customLayoutTags: {
'{tagC}': function() {
return $("#element-id").val();
}
} |
I have uploaded a image using Ajax and i want to delete without refresh the page then how can it possible. when i click on delete button then image is hiding but not remove from database. Please help me to figure out my problem. I am using Yii2 plugin. echo $form->field($packageImages, 'package_img')->widget(\kartik\file\FileInput::classname(), [ |
It would be nice if templates can support custom initial variables. I need this to pass the custom name into the text-input and to pass the initial ID into the data field to do some other actions than just delete.
This is my current approach to do this:
The text was updated successfully, but these errors were encountered: