Open gabriele86 opened 6 years ago
Can you add your render config and your modal definition ?
Sure
Render function: "render": "<button class='btn btn-primary fa fa-plus' ng-click='showDetails([[cellValue]])'></button>",
Modal definition:
`
`
Why put you cellValue inside [[]] ? Are you try : "render": "<button class='btn btn-primary fa fa-plus' ng-click='showDetails(cellValue)'></button>"
?
Are you try to add a breakpoint inside your function showDetails to see what'a happen ?
Why put you cellValue inside [[]] ?
Because i'm using a template engine that use {} to render server side element
Are you try : "render": "" ?
Yes but no value printed it print click="showDetails(cellValue)"
Are you try to add a breakpoint inside your function showDetails to see what'a happen ?
Yes and all work fine ajax call return code 200 and details info
See below the render used inside UDT to open an image inside a modal
'<div ng-click="udtTableFunctions.setImage(cellValue.value,cellValue.fullname,cellValue.width,cellValue.height)" class="thumbnail" ng-if="cellValue !== undefined" >
<div data-target="#udtModalImage" role="button" data-toggle="modal" ><a href="#"><img ng-src="data:image/{{cellValue.extension}};base64,{{cellValue.value}}" width="{{cellValue.width*0.1}}" height="{{cellValue.height*0.1}}"/></a></div></div>'
I hope that's help you.
Is it possible call a jquery click event instead an ng-click event?
to move modal population logic outside angular.
I have tryed changing the button code like this
"render": "<button class='btn btn-primary fa fa-plus' onclick='showDetails(cellValue)'></button>"
But instead printing the cell value it print the string (cellValue)
I don't known if it's possible to call JQuery from Angular.
Hello,
can you try "render": "<button class='btn btn-primary fa fa-plus' ng-click='showDetails(value.data)'></button>"
like the doc here? https://ultimate-datatable.readthedocs.io/en/latest/columns-configuration/#render
You can also try
"render": function(value) {
return "<button class='btn btn-primary fa fa-plus' ng-click='showDetails("+value+")'></button>";
}
The code for this option is here https://github.com/institut-de-genomique/Ultimate-DataTable/blob/5b3aad307037016e7d3c5bcf4cb0ab022b364e34/src/directives/udt-cell.js#L234
Hello I have some problems to get modal window with details working with ultimate datatable.
In my tabel i have a details column that using render function to show a button that on click call an angular function that open a bootstrap modal with details.
The ng-click trigger work as aspected but modal content is empty.
Same logic using datatable.js directly working correctelly