adrianmak Posted January 25, 2016 Posted January 25, 2016 I'm building a form with a markupadmindatatable, one of column is a checkbox for each row, selection for deletion. $out .= "<form action='save' method='post'>"; $table = $this->modules->get("MarkupAdminDataTable"); $table->headerRow(["Name", "Email", "Subject", "Content"]); $listing = $this->pages->get(1024)->children(); foreach($listing as $p) { $checkbox = "<input name='guestbook[]' id='guestbook_{$p->id}' value='{$p->id}' type='checkbox'>"; $data = array( $p->title=>$config->urls->admin."../page/edit/?id=".$p->id, $p->g_email, $p->g_subject, $p->g_content, $checkbox ); $table->row($data); } $out .= $table->render(); $out .= "<button class='ui-button ui-widget ui-corner-all head_button_clone ui-state-default' name='submit_delete_field' value='Delete' type='submit'><span class='ui-button-text'>Delete</span></button>"; $out .= "</form>"; return $out;
Macrura Posted January 25, 2016 Posted January 25, 2016 maybe you need this? $table->setEncodeEntities(false); 2
adrianmak Posted January 25, 2016 Author Posted January 25, 2016 another minor problem is, I out the checkbox prior of the name $checkbox.$p->title=>$config->urls->admin."../page/edit/?id=".$p->id, However, the outputted markup, the input checkbox is wrapped by anchor link, the result is clicking the checkbox will redirect to page edit. How could i display the checkbox out of the anchor link
BitPoet Posted January 25, 2016 Posted January 25, 2016 This is MarkupAdminDataTable's expected behavior (wrapping the value in a link to the key) if you pass an associative entry to row(), so you'll have to build the complete HTML snippet for the column manually. Or, even better, make the checkbox and the link separate columns.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now