With reference to this code,if I am having three columcolumns (eg: including mrks after sub and the mrkd also have different number of rows like subjects.What change should I do now?
add multiple rows in one column using angular ng-repeat
I have updated the fiddle mentioned in the answer of mentioned question.
I have just added below code in html :
<td>{{subject.mark}}</td>
And added the mark in users object.
Please refer UpdatedFiddle
Related
I have to load multiple answers when user click a question.There are multiple questions and each has multiple answers.but when i click second question,the answers of first question are also changing.
I have assigned div id dynamically from my controller in ng-repeat,but when i load data into the div,it always loading data into the first question answers div.div ids are unique in ng-repeat but answers of every question are displaying in all divs.
Sounds to me that you are using the same ng-model for both questions. If you link some of your code I could better examine it.
Use
$('#QuestionID').find('#answerId');
select answer id inside particular question instead of directly taking
$('#answerId')
Breeze & Angular & MV*
I get an invoice object and expand it's necessary properties: Customer, Details, etc.
To access detail properties is easy, invoice.detail[n].property. And saving changes to existing properties (1 - n) is also easy. In my UI, I simply loop through my object vm.invoice.details to get & display all existing details, bind them to inputs, edit at will, call saveChanges(), done!
(keep in mind, in this UI, I need to complete the following too....)
Now, I have blank inputs for a new detail I need to insert.
However, I need to insert a new detail into the existing array of invoice details.
For example: invoice #5 has 3 details (detail[0], detail[1], detail[2]). I need to insert into this existing invoice, detail[3], and call saveChanges()
I've tried to call the manger.createEntity('invoice') but it complains about FK constraints. I know you can pass values as a second argument in createEntity('obj', newvalues)...but is that the correct and only method?
Seems like this should all be much easier but, well, I am at a loss so, please help where you can. TIA!
Take a look at the DocCode sample which has tests for all kinds of scenarios including this one.
Perhaps the following provides the insight you're looking for:
function addNewDetail() {
var newDetail = manager.createEntity('Detail', {
invoice: vm.currentInvoice,
... other initial values
});
// the newDetail will show up automatically if the view is bound to vm.details
}
Notice that I'm initializing the parent invoice navigation property. Alternatively, I could just set the Detail entity's FK property inside the initializer:
...
invoiceId: vm.currentInvoice.id,
...
Either way, Breeze will add the new detail to the details collection of the currentInvoice.
Your question spoke in terms of inserting the new Detail. There is no need to insert the new Detail manually and you can't manage the sort order of the vm.currentInvoice.details property any way.
Breeze has no notion of sort order for collection navigation properties.
If you need to display the details in a particular order you could add a sorting filter to your angular binding to vm.currentInvoice.details.
Make sure you have correct EntityName, because sometimes creating entity is a not as simple as it seems.Before working with entities see
http://www.getbreezenow.com/documentation/creating-entities
I will suggest you to look ur metadata file, go to last line of your file, you can see the field named "entitySet"
"entitySet":{"name":"Entity_Name","entityType":"Self.Entity_Name"}
check the entityName here i took as "Entity_Name" and then try to create the entity and use this name
manger.createEntity('Entity_Name');
I am using ng-table to list a set of elements, and am needing to group the elements in the table.
I want to be able to redefine what the data is sorted by, (even if this means having to redefine the table), as the creation of the table is fast.
I have had a go on JSFiddle, but it doesn't seem to be able to update the grouping.
I aim to have something like the following:
1. create table using initial data, and default grouping column
2. change grouping column using a variable
3. table updates to reflect changed grouping variable
I thought of maybe using an ng-if to surround the entire ng-table, as I've read that it destroys the DOM elements inside it when evaluated to false, but this is a drastic measure to something that may be fairly easy to solve.
Link to JSFiddle
I found what I was looking for.
See the updated JSFiddle here.
What I had to do was call the $scope.tableParams.reload() function.
I didn't find any documentation about this, and ended up looking through the source code.
JSFiddle Link
I'm trying to emulate a spreadsheet using AngularJS and ng-grid. My needs are simple but I cannot find anything anywhere that will help me fix my code.
I have a simple table of scores and in the last column I need a "Total Score" column.
You can see my code at this plunk.
My problem is that though I was able to get the total in each row on document.load, I cannot make the "Total" column update whenever any of the scores are changed.
Or alternatively, you could add the getTotal() function directly to the model object:
http://plnkr.co/edit/LhlK1C?p=preview
I prefer solutions where I don't have to work with $watch(), but it depends if you want the total to be stored in your model or only need it for display.
You could watch for changes to the 'original_data' object and recreate the process_data object every time updates.
http://plnkr.co/edit/c4iynItnznKNRoFgeuio?p=preview
I want add more columns to the tabular report.
I am using bugzilla version 4.2.5.
Can you please help with the files that i have to do modification to?
Thanks,
Ramya
if the required field is not there in column list("Change Columns") we have to add the new field by editing the following files.
1)colchange.cgi
2)list/change-columns.html.tmpl
3)field-descs.none.tmpl
All the coloumns of the buglist are directly taken from the DB fields.
For eg:
ID of the buglist page is directly taken from the field bug_id of table bugs.
New fields can be added and arranged the order in which they have to
display in the file colchange.cgi.
Corresponding template file of colchange.cgi is
list/change-columns.html.tmpl.
If we need any modification in the change coloumn page we have to
modify the template file list/change-columns.html.tmpl.
New fields added should be defined in the file field-descs.none.tmpl.
Modify the following files:
1)buglist.cgi
2)colchange.cgi
3)field-descs.none.tmpl
Added the corresponding coloumn to be displayed in the file colchange.cgi and pass the variables to the template file list/list.html.tmpl.
Defined the name that should be displayed in front end in the file
field-descs.none.tmpl.
Modify the file buglist.cgi for the query that should give the
value for the corresponding field
.
There are two ways to do this.
When you display a report, you will find a link at the bottom that says "Change Columns". That's the wasiest way.
If you wan tot change the default columns the edit the following statement in /usr/local/bugzilla-4.2.5/Bugzilla/Constants.pm and add or remove default columns.
use constant DEFAULT_COLUMN_LIST => (
"product", "component", "assigned_to",
"bug_status", "resolution", "short_desc", "changeddate"
);
EDIT: Just realized that this question is two years old. I hope that it helps someone else who stumbles on it.