membuat button save checkbox
This commit is contained in:
22
component/customcheckbox/customcheckboxv2.templ
Normal file
22
component/customcheckbox/customcheckboxv2.templ
Normal file
@@ -0,0 +1,22 @@
|
||||
package customcheckbox
|
||||
|
||||
import "cpone/models"
|
||||
|
||||
templ MainCustomCheckboxInputV2(inp models.CustomCheckboxv1Prm) {
|
||||
<div class="form-group">
|
||||
<div class="checkbox-list">
|
||||
<label class="checkbox">
|
||||
if (inp.Value == "on") {
|
||||
<input type="checkbox" name={ inp.Name } id={ inp.ID } checked/>
|
||||
} else {
|
||||
<input type="checkbox" name={ inp.Name } id={ inp.ID }/>
|
||||
}
|
||||
<span></span>
|
||||
{ inp.Text }
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="invalid-feedback text-danger mt-3 ml-2 mt-5">
|
||||
{ inp.ErrorMsg }
|
||||
</div>
|
||||
}
|
||||
130
component/customcheckbox/customcheckboxv2_templ.go
Normal file
130
component/customcheckbox/customcheckboxv2_templ.go
Normal file
@@ -0,0 +1,130 @@
|
||||
// Code generated by templ - DO NOT EDIT.
|
||||
|
||||
// templ: version: v0.2.663
|
||||
package customcheckbox
|
||||
|
||||
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||||
|
||||
import "github.com/a-h/templ"
|
||||
import "context"
|
||||
import "io"
|
||||
import "bytes"
|
||||
|
||||
import "cpone/models"
|
||||
|
||||
func MainCustomCheckboxInputV2(inp models.CustomCheckboxv1Prm) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var1 == nil {
|
||||
templ_7745c5c3_Var1 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"form-group\"><div class=\"checkbox-list\"><label class=\"checkbox\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if inp.Value == "on" {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<input type=\"checkbox\" name=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Name)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customcheckbox\customcheckboxv2.templ`, Line: 10, Col: 43}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customcheckbox\customcheckboxv2.templ`, Line: 10, Col: 57}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" checked> ")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
} else {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<input type=\"checkbox\" name=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Name)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customcheckbox\customcheckboxv2.templ`, Line: 12, Col: 43}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var5 string
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customcheckbox\customcheckboxv2.templ`, Line: 12, Col: 57}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"> ")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<span></span> ")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var6 string
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(inp.Text)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customcheckbox\customcheckboxv2.templ`, Line: 15, Col: 14}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</label></div></div><div class=\"invalid-feedback text-danger mt-3 ml-2 mt-5\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var7 string
|
||||
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(inp.ErrorMsg)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `component\customcheckbox\customcheckboxv2.templ`, Line: 20, Col: 16}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
@@ -61,6 +61,7 @@ func (lh *MasterKelainanHandler) HandlerShowMasterKelainan(c echo.Context) error
|
||||
dialogDetailAddBodyID := utils.GenerateRandomID("dialogdetailaddbodyid")
|
||||
dialogDetailDeleteID := utils.GenerateRandomID("dialogDetailDeleteID")
|
||||
dialogDetailDeleteBodyID := utils.GenerateRandomID("dialogDetailDeletebodyID")
|
||||
buttonCheckboxID := utils.GenerateRandomID("buttonCheckboxID")
|
||||
|
||||
// println("cek id param", id)
|
||||
|
||||
@@ -195,7 +196,7 @@ func (lh *MasterKelainanHandler) HandlerShowMasterKelainan(c echo.Context) error
|
||||
"/dev/md/kelainan/opendelete",
|
||||
"#"+dialogDeleteBodyID,
|
||||
"outerHTML",
|
||||
"#dialogDeleteBodyID, #dialogDeleteID, #tableDetailID",
|
||||
"#dialogDeleteBodyID, #dialogDeleteID, #tableDetailID, #buttonCheckboxID",
|
||||
"/dev/md/kelainan/selected",
|
||||
"#"+tableDetailID,
|
||||
)
|
||||
@@ -207,7 +208,7 @@ func (lh *MasterKelainanHandler) HandlerShowMasterKelainan(c echo.Context) error
|
||||
"text",
|
||||
"/dev/md/searchkelainan",
|
||||
"input changed delay:500ms, search",
|
||||
"#"+paginationID, "#loadingcontent", "", "outerHTML", "#tableDetailID, #tableID, #paginationID, #searchID, #dialogDeleteBodyID, #dialogDeleteID",
|
||||
"#"+paginationID, "#loadingcontent", "", "outerHTML", "#tableDetailID, #tableID, #paginationID, #searchID, #dialogDeleteBodyID, #dialogDeleteID, #buttonCheckboxID",
|
||||
masterkelainan.BeforeRequestContent(),
|
||||
masterkelainan.AfterRequestContent())
|
||||
|
||||
@@ -217,7 +218,7 @@ func (lh *MasterKelainanHandler) HandlerShowMasterKelainan(c echo.Context) error
|
||||
1,
|
||||
"/dev/md/kelainanpagination",
|
||||
paginationID,
|
||||
"#tableID, #searchID, #"+searchID+", #paginationID, #dialogDeleteBodyID, #dialogDeleteID, #tableDetailID",
|
||||
"#tableID, #searchID, #"+searchID+", #paginationID, #dialogDeleteBodyID, #dialogDeleteID, #tableDetailID, #buttonCheckboxID",
|
||||
"#"+paginationID,
|
||||
"outerHTML", "", "",
|
||||
masterkelainan.BeforeRequestContent(),
|
||||
@@ -269,11 +270,17 @@ func (lh *MasterKelainanHandler) HandlerShowMasterKelainan(c echo.Context) error
|
||||
|
||||
// component listing table listing kelainan detail
|
||||
contentKelainanDetailCmp := masterkelainan.TableKelainanDetail(
|
||||
dataKelainanDetail, tableDetailID,
|
||||
dataKelainanDetail,
|
||||
models.CustomCheckboxv1Prm{
|
||||
Name: "kelainandetailflagcheck",
|
||||
ID: "kelainandetailflagcheck",
|
||||
Value: "N",
|
||||
},
|
||||
tableDetailID,
|
||||
"/dev/md/kelainandetail/opendelete",
|
||||
"#"+dialogDetailDeleteBodyID,
|
||||
"outerHTML",
|
||||
"#dialogDetailDeleteBodyID, #dialogDetailDeleteID, #tableDetailID",
|
||||
"#dialogDetailDeleteBodyID, #dialogDetailDeleteID, #tableDetailID, #buttonCheckboxID",
|
||||
)
|
||||
|
||||
// filter kelainan detail component
|
||||
@@ -283,7 +290,7 @@ func (lh *MasterKelainanHandler) HandlerShowMasterKelainan(c echo.Context) error
|
||||
"text",
|
||||
"/dev/md/searchkelainandetail",
|
||||
"input changed delay:500ms, searchdetail",
|
||||
"#"+paginationDetailID, "#loadingcontentdetail", "", "none", "#tableDetailID, #paginationDetailID, #searchDetailID, #selectedID, #dialogDetailDeleteBodyID, #dialogDetailDeleteID",
|
||||
"#"+paginationDetailID, "#loadingcontentdetail", "", "none", "#tableDetailID, #paginationDetailID, #searchDetailID, #selectedID, #dialogDetailDeleteBodyID, #dialogDetailDeleteID, #buttonCheckboxID",
|
||||
masterkelainan.BeforeRequestContentDetail(),
|
||||
masterkelainan.AfterRequestContentDetail())
|
||||
|
||||
@@ -293,13 +300,26 @@ func (lh *MasterKelainanHandler) HandlerShowMasterKelainan(c echo.Context) error
|
||||
1,
|
||||
"/dev/md/kelainandetailpagination",
|
||||
paginationDetailID,
|
||||
"#tableDetailID, #searchDetailID, #dialogDetailDeleteBodyID, #dialogDetailDeleteID, #"+searchDetailID+", #paginationDetailID",
|
||||
"#tableDetailID, #searchDetailID, #dialogDetailDeleteBodyID, #dialogDetailDeleteID, #"+searchDetailID+", #paginationDetailID, #buttonCheckboxID",
|
||||
"#"+paginationDetailID,
|
||||
"outerHTML", "", "",
|
||||
masterkelainan.BeforeRequestContentDetail(),
|
||||
masterkelainan.AfterRequestContentDetail(),
|
||||
)
|
||||
|
||||
// button detail checkbox
|
||||
buttonCheckboxCmp := masterkelainan.ButtonSaveCheckbox(
|
||||
totalPageDetail,
|
||||
"/dev/md/kelainandetail/savecheckbox",
|
||||
buttonCheckboxID,
|
||||
"#tableDetailID, #paginationDetailID, #searchDetailID, #selectedID, #dialogDetailDeleteBodyID, #dialogDetailDeleteID, #buttonCheckboxID",
|
||||
"#"+buttonCheckboxID,
|
||||
"outerHTML",
|
||||
"",
|
||||
"",
|
||||
masterkelainan.AfterRequestContentDetail(),
|
||||
)
|
||||
|
||||
// component modal add kelainan detail
|
||||
dialogDetailAddBodyCmp := masterkelainan.BodyFormKelainanDetail(
|
||||
models.CustomTextFieldv2Prm{
|
||||
@@ -409,6 +429,7 @@ func (lh *MasterKelainanHandler) HandlerShowMasterKelainan(c echo.Context) error
|
||||
dialogDetailAddBodyID,
|
||||
dialogDetailDeleteID,
|
||||
dialogDetailDeleteBodyID,
|
||||
buttonCheckboxID,
|
||||
breadcrumbComponent,
|
||||
contentKelainanComponent,
|
||||
kelainanFilterComponent,
|
||||
@@ -418,6 +439,7 @@ func (lh *MasterKelainanHandler) HandlerShowMasterKelainan(c echo.Context) error
|
||||
contentKelainanDetailCmp,
|
||||
kelainanDetailFilterCmp,
|
||||
kelainanDetailPaginationCmp,
|
||||
buttonCheckboxCmp,
|
||||
modaldetailaddcomponent,
|
||||
modalDetailDeleteFormCmp)
|
||||
css := masterkelainan.CssKelainan()
|
||||
@@ -974,6 +996,7 @@ func (lh *MasterKelainanHandler) HandlerUpdateStatusKelainanNonAktif(c echo.Cont
|
||||
func (lh *MasterKelainanHandler) HandlerShowMasterKelainanDetail(c echo.Context) error {
|
||||
logger, _ := zap.NewProduction()
|
||||
id := c.QueryParam("id")
|
||||
buttonCheckboxID := c.QueryParam("buttonCheckboxID")
|
||||
|
||||
dataKelainanDetail, totalPageDetail, err := lh.MasterKelainanService.GetListMasterKelainanDetail(id, "", 1, 5)
|
||||
if err != nil {
|
||||
@@ -985,8 +1008,8 @@ func (lh *MasterKelainanHandler) HandlerShowMasterKelainanDetail(c echo.Context)
|
||||
}
|
||||
|
||||
defer logger.Sync()
|
||||
logger.Info("LOAD KELAINAN DETAIL",
|
||||
zap.Any("data detail", dataKelainanDetail),
|
||||
logger.Info("cek buttonCheckboxID",
|
||||
zap.Any("buttonCheckboxID", buttonCheckboxID),
|
||||
)
|
||||
|
||||
tableDetailID := c.QueryParam("tableDetailID")
|
||||
@@ -1010,11 +1033,17 @@ func (lh *MasterKelainanHandler) HandlerShowMasterKelainanDetail(c echo.Context)
|
||||
|
||||
// component listing table listing kelainan detail
|
||||
contentKelainanDetailCmp := masterkelainan.TableKelainanDetail(
|
||||
dataKelainanDetail, tableDetailID,
|
||||
dataKelainanDetail,
|
||||
models.CustomCheckboxv1Prm{
|
||||
Name: "kelainandetailflagcheck",
|
||||
ID: "kelainandetailflagcheck",
|
||||
Value: "N",
|
||||
},
|
||||
tableDetailID,
|
||||
"/dev/md/kelainandetail/opendelete",
|
||||
"#"+dialogDetailDeleteBodyID,
|
||||
"outerHTML",
|
||||
"#dialogDetailDeleteBodyID, #dialogDetailDeleteID, #tableDetailID",
|
||||
"#dialogDetailDeleteBodyID, #dialogDetailDeleteID, #tableDetailID, #buttonCheckboxID",
|
||||
)
|
||||
|
||||
// pagination kelainan detail component
|
||||
@@ -1023,14 +1052,27 @@ func (lh *MasterKelainanHandler) HandlerShowMasterKelainanDetail(c echo.Context)
|
||||
1,
|
||||
"/dev/md/kelainandetailpagination",
|
||||
paginationDetailID,
|
||||
"#selectedID, #tableDetailID, #searchDetailID, #dialogDetailDeleteBodyID, #dialogDetailDeleteID, #"+searchDetailID+", #paginationDetailID",
|
||||
"#selectedID, #tableDetailID, #searchDetailID, #dialogDetailDeleteBodyID, #dialogDetailDeleteID, #"+searchDetailID+", #paginationDetailID, #buttonCheckboxID",
|
||||
"#"+paginationDetailID,
|
||||
"outerHTML", "", "true",
|
||||
masterkelainan.BeforeRequestContentDetail(),
|
||||
masterkelainan.AfterRequestContentDetail(),
|
||||
)
|
||||
|
||||
return utils.ViewMulti(c, []templ.Component{selectid, contentKelainanDetailCmp, kelainanDetailPaginationCmp})
|
||||
// button detail checkbox
|
||||
buttonCheckboxCmp := masterkelainan.ButtonSaveCheckbox(
|
||||
totalPageDetail,
|
||||
"/dev/md/kelainandetail/savecheckbox",
|
||||
buttonCheckboxID,
|
||||
"#tableDetailID, #paginationDetailID, #searchDetailID, #selectedID, #dialogDetailDeleteBodyID, #dialogDetailDeleteID, #buttonCheckboxID",
|
||||
"#"+buttonCheckboxID,
|
||||
"outerHTML",
|
||||
"",
|
||||
"true",
|
||||
masterkelainan.AfterRequestContentDetail(),
|
||||
)
|
||||
|
||||
return utils.ViewMulti(c, []templ.Component{selectid, contentKelainanDetailCmp, kelainanDetailPaginationCmp, buttonCheckboxCmp})
|
||||
}
|
||||
|
||||
func (lh *MasterKelainanHandler) HandlerShowMdKelainanDetailSearch(c echo.Context) error {
|
||||
@@ -1058,6 +1100,11 @@ func (lh *MasterKelainanHandler) HandlerShowMdKelainanDetailSearch(c echo.Contex
|
||||
|
||||
contentKelainanDetailCmp := masterkelainan.TableKelainanDetail(
|
||||
dataKelainanDetail,
|
||||
models.CustomCheckboxv1Prm{
|
||||
Name: "kelainandetailflagcheck",
|
||||
ID: "kelainandetailflagcheck",
|
||||
Value: "N",
|
||||
},
|
||||
tableDetailID,
|
||||
"/dev/md/kelainandetail/opendelete",
|
||||
"#"+dialogDetailDeleteBodyID,
|
||||
@@ -1119,6 +1166,11 @@ func (lh *MasterKelainanHandler) HandlerShowMdKelainanDetailPagination(c echo.Co
|
||||
|
||||
contentKelainanDetailCmp := masterkelainan.TableKelainanDetail(
|
||||
dataKelainanDetail,
|
||||
models.CustomCheckboxv1Prm{
|
||||
Name: "kelainandetailflagcheck",
|
||||
ID: "kelainandetailflagcheck",
|
||||
Value: "N",
|
||||
},
|
||||
tableDetailID,
|
||||
"/dev/md/kelainandetail/opendelete",
|
||||
"#"+dialogDetailDeleteBodyID,
|
||||
@@ -1312,7 +1364,13 @@ func (lh *MasterKelainanHandler) HandlerAddKelainanDetail(c echo.Context) error
|
||||
|
||||
// new table listing
|
||||
contentKelainanDetailComponent := masterkelainan.TableKelainanDetail(
|
||||
dataKelainanDetailList, tableDetailID,
|
||||
dataKelainanDetailList,
|
||||
models.CustomCheckboxv1Prm{
|
||||
Name: "kelainandetailflagcheck",
|
||||
ID: "kelainandetailflagcheck",
|
||||
Value: "N",
|
||||
},
|
||||
tableDetailID,
|
||||
"/dev/md/kelainandetail/opendelete",
|
||||
"#"+dialogDetailDeleteBodyID,
|
||||
"outerHTML",
|
||||
@@ -1487,7 +1545,13 @@ func (lh *MasterKelainanHandler) HandlerDeleteKelainanDetail(c echo.Context) err
|
||||
}
|
||||
}
|
||||
|
||||
tablecomponent := masterkelainan.TableKelainanDetail(kelainanDetailList,
|
||||
tablecomponent := masterkelainan.TableKelainanDetail(
|
||||
kelainanDetailList,
|
||||
models.CustomCheckboxv1Prm{
|
||||
Name: "kelainandetailflagcheck",
|
||||
ID: "kelainandetailflagcheck",
|
||||
Value: "N",
|
||||
},
|
||||
tableDetailID,
|
||||
"/dev/md/kelainandetail/opendelete",
|
||||
"#"+dialogDetailDeleteBodyID,
|
||||
|
||||
@@ -21,6 +21,7 @@ templ ContentMasterKelainan(
|
||||
dialogDetailAddBodyID string,
|
||||
dialogDetailDeleteID string,
|
||||
dialogDetailDeleteBodyID string,
|
||||
buttonCheckboxID string,
|
||||
breadcrumb templ.Component,
|
||||
tablecontent templ.Component,
|
||||
filterComponent templ.Component,
|
||||
@@ -30,6 +31,7 @@ templ ContentMasterKelainan(
|
||||
tabledetailcontent templ.Component,
|
||||
filterDetailComponent templ.Component,
|
||||
paginationDetailComponent templ.Component,
|
||||
buttonDetailCheckbox templ.Component,
|
||||
modalDetailAddForm templ.Component,
|
||||
modalDetailForm templ.Component,
|
||||
) {
|
||||
@@ -95,6 +97,10 @@ templ ContentMasterKelainan(
|
||||
Name: "dialogDetailDeleteBodyID",
|
||||
Type: "hidden",
|
||||
Value: dialogDetailDeleteBodyID})
|
||||
@customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "buttonCheckboxID",
|
||||
Name: "buttonCheckboxID",
|
||||
Type: "hidden",
|
||||
Value: buttonCheckboxID})
|
||||
<div class="row align-items-center mb-10">
|
||||
<div class="col-md-10 col-sm-12 p-0 ">
|
||||
@breadcrumb
|
||||
@@ -166,6 +172,7 @@ templ ContentMasterKelainan(
|
||||
<div id="loading-parent-detail" class=" rounded">
|
||||
@tabledetailcontent
|
||||
@paginationDetailComponent
|
||||
@buttonDetailCheckbox
|
||||
@modalDetailAddForm
|
||||
@modalDetailForm
|
||||
<div id="loading-child-detail" class=" rounded bg-transparent">
|
||||
|
||||
@@ -31,6 +31,7 @@ func ContentMasterKelainan(
|
||||
dialogDetailAddBodyID string,
|
||||
dialogDetailDeleteID string,
|
||||
dialogDetailDeleteBodyID string,
|
||||
buttonCheckboxID string,
|
||||
breadcrumb templ.Component,
|
||||
tablecontent templ.Component,
|
||||
filterComponent templ.Component,
|
||||
@@ -40,6 +41,7 @@ func ContentMasterKelainan(
|
||||
tabledetailcontent templ.Component,
|
||||
filterDetailComponent templ.Component,
|
||||
paginationDetailComponent templ.Component,
|
||||
buttonDetailCheckbox templ.Component,
|
||||
modalDetailAddForm templ.Component,
|
||||
modalDetailForm templ.Component,
|
||||
) templ.Component {
|
||||
@@ -165,6 +167,13 @@ func ContentMasterKelainan(
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customtextfield.CustomTextFieldv2(models.CustomTextFieldv2Prm{ID: "buttonCheckboxID",
|
||||
Name: "buttonCheckboxID",
|
||||
Type: "hidden",
|
||||
Value: buttonCheckboxID}).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"row align-items-center mb-10\"><div class=\"col-md-10 col-sm-12 p-0 \">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
@@ -188,7 +197,7 @@ func ContentMasterKelainan(
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs("#" + dialogAddID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\masterkelainan.templ`, Line: 115, Col: 39}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\masterkelainan.templ`, Line: 121, Col: 39}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -201,7 +210,7 @@ func ContentMasterKelainan(
|
||||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs("#" + dialogAddID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\masterkelainan.templ`, Line: 124, Col: 38}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\masterkelainan.templ`, Line: 130, Col: 38}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -242,7 +251,7 @@ func ContentMasterKelainan(
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs("#" + dialogDetailAddID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\masterkelainan.templ`, Line: 153, Col: 45}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\masterkelainan.templ`, Line: 159, Col: 45}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -255,7 +264,7 @@ func ContentMasterKelainan(
|
||||
var templ_7745c5c3_Var5 string
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs("#" + dialogDetailAddID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\masterkelainan.templ`, Line: 162, Col: 44}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\masterkelainan.templ`, Line: 168, Col: 44}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -273,6 +282,10 @@ func ContentMasterKelainan(
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = buttonDetailCheckbox.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = modalDetailAddForm.Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
|
||||
@@ -3,8 +3,10 @@ package masterkelainan
|
||||
import "cpone/models"
|
||||
import "cpone/component/table"
|
||||
import "strconv"
|
||||
import "cpone/component/customcheckbox"
|
||||
|
||||
templ TableKelainanDetail(data []models.KelainanDetail,
|
||||
checkboxFlagPerKelainan models.CustomCheckboxv1Prm,
|
||||
tableDetailID string,
|
||||
hxGetDelete string,
|
||||
hxTargetDelete string,
|
||||
@@ -15,6 +17,7 @@ templ TableKelainanDetail(data []models.KelainanDetail,
|
||||
@tablecomponent.TableV3([]string{"NO", "KELAINAN", "AKSI"},
|
||||
[]string{"10%", "60%", "30%"},
|
||||
TableDetailRow(data,
|
||||
checkboxFlagPerKelainan,
|
||||
hxGetDelete,
|
||||
hxTargetDelete,
|
||||
hxSwapDelete,
|
||||
@@ -24,6 +27,7 @@ templ TableKelainanDetail(data []models.KelainanDetail,
|
||||
}
|
||||
|
||||
templ TableDetailRow(data []models.KelainanDetail,
|
||||
checkboxFlagPerKelainan models.CustomCheckboxv1Prm,
|
||||
hxGetDelete string,
|
||||
hxTargetDelete string,
|
||||
hxSwapDelete string,
|
||||
@@ -45,6 +49,7 @@ templ TableDetailRow(data []models.KelainanDetail,
|
||||
</td>
|
||||
<td>
|
||||
@TableDetailAction(v.Mcu_KelainanID,
|
||||
checkboxFlagPerKelainan,
|
||||
hxGetDelete,
|
||||
hxTargetDelete,
|
||||
hxSwapDelete,
|
||||
@@ -57,16 +62,16 @@ templ TableDetailRow(data []models.KelainanDetail,
|
||||
|
||||
templ TableDetailAction(
|
||||
id int,
|
||||
checkboxFlagPerKelainan models.CustomCheckboxv1Prm,
|
||||
hxGetDelete string,
|
||||
hxTargetDelete string,
|
||||
hxSwapDelete string,
|
||||
hxIncludeDelete string,
|
||||
) {
|
||||
<div class="row px-5 d-flex justify-content-around">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" name="Checkboxes1"/>
|
||||
<span></span>
|
||||
</label>
|
||||
@customcheckbox.MainCustomCheckboxInputV2(
|
||||
checkboxFlagPerKelainan,
|
||||
)
|
||||
<a
|
||||
id="btndeleteug"
|
||||
type="button"
|
||||
@@ -80,3 +85,47 @@ templ TableDetailAction(
|
||||
</a>
|
||||
</div>
|
||||
}
|
||||
|
||||
script JsHideButtonCheckbox(selectedID string) {
|
||||
$(selectedID).hide();
|
||||
console.log("hide", selectedID)
|
||||
}
|
||||
|
||||
script JsShowButtonCheckbox(selectedID string) {
|
||||
$(selectedID).show();
|
||||
console.log("show", selectedID)
|
||||
}
|
||||
|
||||
templ ButtonSaveCheckbox(
|
||||
length int,
|
||||
link string,
|
||||
buttonCheckboxID string,
|
||||
hxInclude string,
|
||||
hxTarget string,
|
||||
hxSwap string,
|
||||
hxIndicator string,
|
||||
HxSwapOobButton string,
|
||||
hxAfterRequest templ.ComponentScript,
|
||||
) {
|
||||
<div
|
||||
id={ buttonCheckboxID }
|
||||
hx-on::load={ hxAfterRequest }
|
||||
hx-swap-oob={ HxSwapOobButton }
|
||||
class="d-flex justify-content-end"
|
||||
>
|
||||
if length != 0 {
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnaddact"
|
||||
>
|
||||
Batal
|
||||
</button>
|
||||
<button
|
||||
type="submit"
|
||||
class="btn btn-primary btn-shadow font-weight-bold rounded-lg btnaddact"
|
||||
>
|
||||
Simpan
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -13,8 +13,10 @@ import "bytes"
|
||||
import "cpone/models"
|
||||
import "cpone/component/table"
|
||||
import "strconv"
|
||||
import "cpone/component/customcheckbox"
|
||||
|
||||
func TableKelainanDetail(data []models.KelainanDetail,
|
||||
checkboxFlagPerKelainan models.CustomCheckboxv1Prm,
|
||||
tableDetailID string,
|
||||
hxGetDelete string,
|
||||
hxTargetDelete string,
|
||||
@@ -40,7 +42,7 @@ func TableKelainanDetail(data []models.KelainanDetail,
|
||||
var templ_7745c5c3_Var2 string
|
||||
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(tableDetailID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\mdkelainandetailtable.templ`, Line: 14, Col: 24}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\mdkelainandetailtable.templ`, Line: 16, Col: 24}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -53,6 +55,7 @@ func TableKelainanDetail(data []models.KelainanDetail,
|
||||
templ_7745c5c3_Err = tablecomponent.TableV3([]string{"NO", "KELAINAN", "AKSI"},
|
||||
[]string{"10%", "60%", "30%"},
|
||||
TableDetailRow(data,
|
||||
checkboxFlagPerKelainan,
|
||||
hxGetDelete,
|
||||
hxTargetDelete,
|
||||
hxSwapDelete,
|
||||
@@ -73,6 +76,7 @@ func TableKelainanDetail(data []models.KelainanDetail,
|
||||
}
|
||||
|
||||
func TableDetailRow(data []models.KelainanDetail,
|
||||
checkboxFlagPerKelainan models.CustomCheckboxv1Prm,
|
||||
hxGetDelete string,
|
||||
hxTargetDelete string,
|
||||
hxSwapDelete string,
|
||||
@@ -104,7 +108,7 @@ func TableDetailRow(data []models.KelainanDetail,
|
||||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(v.Nomor)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\mdkelainandetailtable.templ`, Line: 39, Col: 16}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\mdkelainandetailtable.templ`, Line: 43, Col: 16}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -117,7 +121,7 @@ func TableDetailRow(data []models.KelainanDetail,
|
||||
var templ_7745c5c3_Var5 string
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(v.Mcu_KelainanName)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\mdkelainandetailtable.templ`, Line: 41, Col: 24}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\mdkelainandetailtable.templ`, Line: 45, Col: 24}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -135,7 +139,7 @@ func TableDetailRow(data []models.KelainanDetail,
|
||||
var templ_7745c5c3_Var6 string
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(v.Mcu_KelainanClasification)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\mdkelainandetailtable.templ`, Line: 43, Col: 54}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\mdkelainandetailtable.templ`, Line: 47, Col: 54}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -151,6 +155,7 @@ func TableDetailRow(data []models.KelainanDetail,
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = TableDetailAction(v.Mcu_KelainanID,
|
||||
checkboxFlagPerKelainan,
|
||||
hxGetDelete,
|
||||
hxTargetDelete,
|
||||
hxSwapDelete,
|
||||
@@ -173,6 +178,7 @@ func TableDetailRow(data []models.KelainanDetail,
|
||||
|
||||
func TableDetailAction(
|
||||
id int,
|
||||
checkboxFlagPerKelainan models.CustomCheckboxv1Prm,
|
||||
hxGetDelete string,
|
||||
hxTargetDelete string,
|
||||
hxSwapDelete string,
|
||||
@@ -190,14 +196,24 @@ func TableDetailAction(
|
||||
templ_7745c5c3_Var7 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"row px-5 d-flex justify-content-around\"><label class=\"checkbox\"><input type=\"checkbox\" name=\"Checkboxes1\"> <span></span></label> <a id=\"btndeleteug\" type=\"button\" class=\" btndeleteug col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-danger mb-2\" hx-get=\"")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"row px-5 d-flex justify-content-around\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
templ_7745c5c3_Err = customcheckbox.MainCustomCheckboxInputV2(
|
||||
checkboxFlagPerKelainan,
|
||||
).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a id=\"btndeleteug\" type=\"button\" class=\" btndeleteug col-12 col-sm-12 col-md-12 col-lg-5 col-xl-5 col-xxl-5 btn btn-light-danger mb-2\" hx-get=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var8 string
|
||||
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(hxGetDelete + "?id=" + strconv.Itoa(id))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\mdkelainandetailtable.templ`, Line: 74, Col: 51}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\mdkelainandetailtable.templ`, Line: 79, Col: 51}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -210,7 +226,7 @@ func TableDetailAction(
|
||||
var templ_7745c5c3_Var9 string
|
||||
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(hxTargetDelete)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\mdkelainandetailtable.templ`, Line: 75, Col: 29}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\mdkelainandetailtable.templ`, Line: 80, Col: 29}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -223,7 +239,7 @@ func TableDetailAction(
|
||||
var templ_7745c5c3_Var10 string
|
||||
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(hxSwapDelete)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\mdkelainandetailtable.templ`, Line: 76, Col: 25}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\mdkelainandetailtable.templ`, Line: 81, Col: 25}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -236,7 +252,7 @@ func TableDetailAction(
|
||||
var templ_7745c5c3_Var11 string
|
||||
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(hxIncludeDelete)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\mdkelainandetailtable.templ`, Line: 77, Col: 31}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\mdkelainandetailtable.templ`, Line: 82, Col: 31}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
@@ -252,3 +268,108 @@ func TableDetailAction(
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
func JsHideButtonCheckbox(selectedID string) templ.ComponentScript {
|
||||
return templ.ComponentScript{
|
||||
Name: `__templ_JsHideButtonCheckbox_0f00`,
|
||||
Function: `function __templ_JsHideButtonCheckbox_0f00(selectedID){$(selectedID).hide();
|
||||
console.log("hide", selectedID)
|
||||
}`,
|
||||
Call: templ.SafeScript(`__templ_JsHideButtonCheckbox_0f00`, selectedID),
|
||||
CallInline: templ.SafeScriptInline(`__templ_JsHideButtonCheckbox_0f00`, selectedID),
|
||||
}
|
||||
}
|
||||
|
||||
func JsShowButtonCheckbox(selectedID string) templ.ComponentScript {
|
||||
return templ.ComponentScript{
|
||||
Name: `__templ_JsShowButtonCheckbox_f46b`,
|
||||
Function: `function __templ_JsShowButtonCheckbox_f46b(selectedID){$(selectedID).show();
|
||||
console.log("show", selectedID)
|
||||
}`,
|
||||
Call: templ.SafeScript(`__templ_JsShowButtonCheckbox_f46b`, selectedID),
|
||||
CallInline: templ.SafeScriptInline(`__templ_JsShowButtonCheckbox_f46b`, selectedID),
|
||||
}
|
||||
}
|
||||
|
||||
func ButtonSaveCheckbox(
|
||||
length int,
|
||||
link string,
|
||||
buttonCheckboxID string,
|
||||
hxInclude string,
|
||||
hxTarget string,
|
||||
hxSwap string,
|
||||
hxIndicator string,
|
||||
HxSwapOobButton string,
|
||||
hxAfterRequest templ.ComponentScript,
|
||||
) templ.Component {
|
||||
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||||
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var12 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var12 == nil {
|
||||
templ_7745c5c3_Var12 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
templ_7745c5c3_Err = templ.RenderScriptItems(ctx, templ_7745c5c3_Buffer, hxAfterRequest)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var13 string
|
||||
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(buttonCheckboxID)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\mdkelainandetailtable.templ`, Line: 111, Col: 23}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-on::load=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var14 templ.ComponentScript = hxAfterRequest
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var14.Call)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap-oob=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var15 string
|
||||
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(HxSwapOobButton)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\mdkelainandetailtable.templ`, Line: 113, Col: 31}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"d-flex justify-content-end\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if length != 0 {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<button type=\"button\" class=\"btn btn-outline-secondary font-weight-bolder rounded-lg mr-4 btnaddact\">Batal\r</button> <button type=\"submit\" class=\"btn btn-primary btn-shadow font-weight-bold rounded-lg btnaddact\">Simpan\r</button>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ templ TableRow(data []models.Kelainan,
|
||||
id={ "sas" + strconv.Itoa(v.Mcu_KelainanGroupID) }
|
||||
hx-get={ hxGetSelected + "?id=" + strconv.Itoa(v.Mcu_KelainanGroupID) }
|
||||
hx-trigger="click"
|
||||
hx-include={ "#selectedID, #paginationID, #dialogDeleteBodyID, #dialogDeleteID, #tableID, #tableDetailID, #paginationDetailID, #searchDetailID, #dialogDetailDeleteBodyID, #dialogDetailDeleteID, #sas" + strconv.Itoa(v.Mcu_KelainanGroupID) }
|
||||
hx-include={ "#buttonCheckboxID, #selectedID, #paginationID, #dialogDeleteBodyID, #dialogDeleteID, #tableID, #tableDetailID, #paginationDetailID, #searchDetailID, #dialogDetailDeleteBodyID, #dialogDetailDeleteID, #sas" + strconv.Itoa(v.Mcu_KelainanGroupID) }
|
||||
onclick={ clickHandler(strconv.Itoa(v.Mcu_KelainanGroupID)) }
|
||||
hx-target={ hxTargetSelected }
|
||||
hx-on::after-request={ HandleAfterRequesX(strconv.Itoa(v.Mcu_KelainanGroupID)) }
|
||||
|
||||
@@ -177,9 +177,9 @@ func TableRow(data []models.Kelainan,
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var6 string
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs("#selectedID, #paginationID, #dialogDeleteBodyID, #dialogDeleteID, #tableID, #tableDetailID, #paginationDetailID, #searchDetailID, #dialogDetailDeleteBodyID, #dialogDetailDeleteID, #sas" + strconv.Itoa(v.Mcu_KelainanGroupID))
|
||||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs("#buttonCheckboxID, #selectedID, #paginationID, #dialogDeleteBodyID, #dialogDeleteID, #tableID, #tableDetailID, #paginationDetailID, #searchDetailID, #dialogDetailDeleteBodyID, #dialogDetailDeleteID, #sas" + strconv.Itoa(v.Mcu_KelainanGroupID))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\mdkelainantable.templ`, Line: 75, Col: 240}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `views\dev\mdpolakelainan\mdkelainantable.templ`, Line: 75, Col: 259}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
|
||||
Reference in New Issue
Block a user