save muliple value on selection of checkbox in cakephp - cakephp

I have two table First-taxonomy, second-product.
relationship between both table- taxonomy hasMany product and product belongs to taxonomy.
I have to save many taxonomy id in product table on selection of checkbox.
Only selected checkbox value should save in product table.
controller
add.ctp

For all checkbox give name as:
name="data['Product'][]['taxanomy_id']"
In your controller , within function add :
public function add() {
$this->Product->create();
if($this->Product->saveAll($this->request-data)){
// saved
}
}

Related

SSRS - modify PageName using pagebreaks/group by elements

I have an SSRS report that has one Tablix, it is grouped based on a field 'venue'
It has a checkbox for 'Page break options' Between each instance of the group.
So each venue has its own page of data however PageName is set to one value under properties.
Is there a way to automate each page/instance of the venue to be more dynamic.
Click the Row Group at the bottom to toggle the "Tablix Member" properties.
Then you can see the PageName in Group section.
On your case, PageName =Fields!venue.value
Pick Expression at the PageName,
=First(Fields!venue.Value, "dataset")

Dependent submit button in angular to fetch JSON file and display

I'm working on an AngularJS project, also pretty new to this and have managed to create a dependent drop-down menu.
Example:
Parent Drop-down- Cars
- Bikes
Child Drop-down- BMW, Audi
- Yamaha, Honda
So from the above example, if I choose Cars in the first drop-down it will display BMW and Audi in the second drop-down. Same for bikes.
Now if the user chooses BMW and clicks the submit button I want it to redirect to a URL which contains a JSON file and display the result in the form of a table.
If the user chooses Yamaha similarly it should redirect to another JSON URL and display the result in a table.
How can this be achieved in AngularJS, with a single "Submit" button?
Any help is much appreciated.
Regards.
Your vehicle dropdown should have unique ID such as cars for 1, bikes for 2 here 1 and 2 are unique ID for this category of vehicles.
Now on submit call a function which will take you to another page now, send this uniqueID of vehicles into statparams and on that page and on page OnInit make a http call and bind the models to that dropdown.

how do it associate a dropdown-menu input to another databasetable with laravel

I've got a form that fills a table in my database. Now i've added a dropdown to that form where the you can choose a user that should be associated to the rest of the form input. But im still unable to associate the dropdown to the user_id in the table.
I hope i made my issue clear,
The code that i just in my controller was :
public function store(PartRequest $request)
{
Project::find(Input::get('project'))->parts()->create($request->all());
return redirect('parts');
}
where my dropdown had classname:project

How to access hidden column in angular js

I have a column named id in my datagrid. I have set visible:false for the field since I don't want to display the field in the grid.
But then how can I get the value in id? any hope?
I am adding column as
columns.push({'sTitle':'id','visible': 'false'},{'sTitle':'name','visible': 'false'});
And I am retrieving the value in selected row as
this.$view.on("click",function(event){
selectedRow = event.target.parentElement;
var name = selectedRow.cells[0].innerHTML;
}
Here in click event I can't get the value of id as html is not generated for the field with visible:false. So I am searching for a method to access my id field.
You should use display:none property
-Edit:
In order to specify a custom css to your angular datagrid you should also specify the columns. Something like:
$("#gridContainer").dxDataGrid({
// ...
columns: ['CompanyName', 'ContactName', 'City', 'Country']
});
Here's the page I referenced to
Edit2:
Since you're trying to retrieve the value of the field I would recommend you to take a look to this answer

extjs load records into form

ProductStore consist of several products and its descriptions.
product item I select from combo, description from textarea.
How can I load them back into form(combo, textarea).
Thanks in advance
I assume the combo is loaded from the store so the combo box has the id of the products. Put a listener on the combo box when a product is selected from the combo box get its id. Look up the id in the store and get the record. Take that record and get the data you need and populate the fields with it. Here's the basic idea you'll need to adapt this to your code.
var productId = combo.getValue(); //the id from the selected product in the combo box.
var rec = store.getById(productId );
//You can also use rec.get('description');
var desc = rec.data.description;
var productName= rec.data.name;
var id= rec.data.id;
//Now take these values and use them to fill in your form
textField.setValue(desc);

Resources