I'm using this jquery plugin in my Laravel website and this is a repeater field plugin. I'm wondering how can I detect a edited or removed repeater item field in my edit post page so I can update or destroy that specific item in the database?! I'm asking this because names get reindexed dynamically by plugin if an item is removed.
I solved my problem by adding a hidden input with the value of item id for each repeater items.
Related
in a Vuetify project I would like to dynamically create all the required fields to perform CRUD Actions:
I prepared a working sample here:
https://codepen.io/jslab-it/pen/KKqyBdX
Everything's working not bad, but when I click on the edit button, the dialog appears but fields are not populated:
I assume that problem is that v-model is "calculated":
:v-model="'editedItem.'+f.name"
in fact in the last field that is not generated but hardcoded and thus has
v-model="editedItem.calories"
the field is automatically populated.
I tried also using a computer property for editedItem, but without success
Can suggest if it is possible and the right path?
Thanks
You can use editedItem[f.name], which is a standard way to access dynamic property in js.
I have a Kendo ListView bound to an Observable object and all is working well.
I'm able to:
Add items to the list
Edit existing items by using the edit template below
Delete items
One oddity though is when I switch an item to edit view and click Cancel it resets all data back to the original data. So if I started with one item with say name and amount fields, I edit the item and change the amount, then add two more items to the list all is well. But then I click edit on any of the items and immediately click cancel, from here it removes all the additional items I added and resets the data for the first item back to what it was at the beginning.
Why would the cancel action do that?
This dojo snippet shows the exact problem I'm having: http://dojo.telerik.com/IKowo
Kendo version 2016.3.1118
EDIT:
One further development, I found a forum post on Telerik stating that you have to have an ID column and a schema:model:id setup otherwise things won't work as expected.
I've updated the dojo snippet as follows: http://dojo.telerik.com/IKowo/2
Since adding the ID to the mix it looks like the amounts aren't being affected by the cancel button but the newly added items still get removed.
Follow the example provided here by telerik
//Binding Listview to local data array & Perform CRUD
http://dojo.telerik.com/eWih/2
The Only Requirement for the cancel event not deleting the new Items is:
The id field should be kept 0 when adding the new item to the datasource
It should be incremented / Updated in the datasource transport.create event (REQUIRED)
happy coding!
I'm a newbie in Drupal and I'm trying to create custom forms in Drupal 8 using 'YAML Form' module:
https://www.drupal.org/project/yamlform
I have added some 'select' elements with some custom options from the Form elements page provided by the module, but I don't find the way to populate these elements from database.
How can I do it? Step by step if possible, please.
Thanks in advance!
I don't know if it's the best way to do it but it works for me:
I've created a custom module and in the '.module' file I've implemented the hook hook_yamlform_options_YAMLFORM_OPTIONS_ID_alter() when the part YAMLFORM_OPTIONS_ID is the ID of a custom set of options I've added in the Options page (admin/structure/yamlform/settings/options/manage).
The code of the hook, basically, gets data from database and sets it in the $options array with the desired keys and values.
Then when I access to the Options page again, in the row of the new custom set of options, the column ALTERED has the value 'Yes'. Click to 'Edit' this row and then click to 'Reset' button. The result is that the options value/text table is updated automatically with the data returned from database.
Magento 1.7.2 (adminpanel attribute)
TypeError: this.fileValue.toJSON is not a function
$(this.idName+'_save').value = this.fileValue.toJSON();
I have add Attribute drop down option value multiple but after saving
data only one value display there. How to get all attribute option
list.
I have added there option
after save only one value there.
Attribute label option issue generate with Ecommerce Team
SEO Layered Navigation. so i have disable this plugin on this
place on my Project.
app/etc/modules
EcommerceTeam_Sln.xml
I have a CodeIgniter webpage containing (i) a list of items and (ii) a form to add a new item or edit the details of a selected item.
To select an item for editing, I have an "edit" anchor tag with a hyperlink ending with ?id=nnn. This results in a GET request that populates the detail fields of my selected item and redisplays the list. My URL now contains site_address/index.php/country?id=151.
When I submit my changes the list is updated correctly but my URL remains unchanged. What do I need to do in my controller to remove "?id=151 after my update was successful?
Thanks for your help.
I'm not sure of everything you are doing, so I'll just answer directly:
in your controller, after you update, you can:
redirect('site_address/index.php/country');
Does that fit what you mean?
Through php there's no way to change URL after request expect redirecting
redirect('controller/method');
and you can success message using session flash message after redirecting, if that what makes you want to reload the view