2 <div id="title_list_result">
3 <table :id="table_id"></table>
8 import { inject, createVNode, render } from "vue"
9 import { useDataTable } from "../../composables/datatables"
13 const AVStore = inject("AVStore")
14 const { get_lib_from_av, map_av_dt_filter } = AVStore
16 const table_id = "title_list"
17 useDataTable(table_id)
29 show_resource: function (resource_id) {
31 "/cgi-bin/koha/erm/eholdings/local/resources/" + resource_id
34 build_datatable: function () {
35 let show_resource = this.show_resource
36 let package_id = this.package_id
37 let get_lib_from_av = this.get_lib_from_av
38 let map_av_dt_filter = this.map_av_dt_filter
39 let table_id = this.table_id
41 window["av_title_publication_types"] = map_av_dt_filter(
42 "av_title_publication_types"
45 $("#" + table_id).kohaTable(
49 "/api/v1/erm/eholdings/local/packages/" +
58 data: "title.publication_title",
61 render: function (data, type, row, meta) {
62 // Rendering done in drawCallback
67 title: __("Publication type"),
68 data: "title.publication_type",
71 render: function (data, type, row, meta) {
74 "av_title_publication_types",
75 row.title.publication_type
81 drawCallback: function (settings) {
82 var api = new $.fn.dataTable.Api(settings)
85 $(this).find("tbody tr td:first-child"),
87 let tr = $(this).parent()
88 let row = api.row(tr).data()
89 if (!row) return // Happen if the table is empty
95 "/cgi-bin/koha/erm/eholdings/local/resources/" +
99 show_resource(row.resource_id)
102 `${row.title.publication_title}`
108 preDrawCallback: function (settings) {
112 .attr("data-filter", "av_title_publication_types")
121 this.build_datatable()
126 name: "EHoldingsLocalPackageTitlesList",