I have some portlets that have an ID for each What are I trying to do, After pressing the AD button, you have to pass in a popup model.
Here is the Portrait View:
@forach ($ Portlets $ as portlet) & lt; Div class = "box span4" & gt; & Lt; Div class = "box-header departure" data-original-title & gt; & Lt; H2 & gt; & Lt; I class = "icon-and" & gt; & Lt; / I & gt; {{$ Portlet- & gt; Portlet_top}} & lt; / H2 & gt; & Lt; / Div & gt; & Lt; Div class = "box-content" & gt; & Lt; Div class = "line-fluid" & gt; // Here's some content & lt; / Div & gt; & Lt; Div class = "box-icon" & gt; & Lt; A href = "#" class = "btn-btn-setting leak btn-round" title = "add new link" data-rel = "tooltip" & gt; & Lt; I class = "icon-plus-sign" & gt; & Lt; / I & gt; & Lt; / A & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; @Ageenter Note the Add New Link button at the bottom of the code, when I suppress it, a model will appear. Here's the result:
& lt; Div class = "modal hide fade" id = "link settings" & gt; & Lt; Div class = "modal-header" & gt; & Lt; Button type = "button" class = "off" data-discarded = "model" & gt; One ?? & Lt; / Button & gt; & Lt; H3 & gt; Add new link & lt; / H3 & gt; & Lt; / Div & gt; & Lt; Form method = "post" action = "{{URL :: from ('adlink')}" & gt; & Lt; Div class = "modal-body" & gt; & Lt; Div class = "control-group" & gt; & Lt; = "Focused input" for label class = "control-label" & gt; Link title: & lt; / Label & gt; & Lt; Div class = "control" & gt; & Lt; Input class = "Input-excel focused" id = "link_title" name = "link_title" type = "text" & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "control-group" & gt; & Lt; Label class = "control-label" = "focused input" & gt; Add a link: & lt; / Label & gt; & Lt; Div class = "control" & gt; & Lt; Input class = "input-xlarge focus" id = "link_url" name = "link_url" placeholder = "e.g., http://www.example.com/" type = "text" & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "modal-footer" & gt; & Lt; A href = "#" class = "btn" data-rejected = "model" & gt; Close & lt; / A & gt; & Lt; Input type = "submit" id = "submit" name = "submit" value = "submit" class = "btn btn-primary" & gt; & Lt; / Div & gt; & Lt; / Form & gt; & Lt; / Div & gt; This model has a form to process in the controller. But how do I send portlet IDs for this model, so that it can be stored in the database during processing in the controller? Because I want to know it automatically that I want to add that link.
You can add a jQuery event handler to click on the "Add new link" button, and use it to view the model view To populate a hidden field in.
means something like:
$ ("a.new_link"). Click (function () {portlet_id = $ (this) .Parent (). Attr ("id"); $ ("Div.modal form input.my_hidden_field"). Val (portlet_id)}); For more models & lt; Form & gt; in & lt; Input type = "hidden" name = "portlet_id" class = "my_hidden_field" /> Then, you only need to get the portlet_id POST parameter with Laravel / PHP to use Portlet ID. Edit
Modified handler based on the code that you provide:
$ ('.btn- settings link'). Click (function (e) {e.preventDefault (); $ ('#linkSettings'). Mâ € ???? ??? al ('Show'); // get portlet_id and modify the midden field Portlet_id = $ (this) .Parent (). Attr ("Id"); $ ("div.modal form input.my_hidden_field"). Val (portlet_id)});
No comments:
Post a Comment