Using a <label> element with the for attribute on ngTagsInput - ng-tags-input

Using ng-tags-input works well, but I have a <label for="my-field"> which doesn't work. The actual input element inside the ng-tags-input element has no name or id attribute, so I can't target it with the for attribute. Is there something I'm missing or do I have to use custom JavaScript to get it to behave like a regular label in a browser where clicking on the label focuses the field?
Here's a plunkr showing the problem: http://plnkr.co/edit/D3OLro?p=preview
The first input can be focused by clicking the label, but not the ng-tags-input

Related

how to place a kendo check box label on the left

I have the following peace of code:
#(Html.Kendo().CheckBoxFor(m => m.IsActive).Label("Active:"))
I would like the label to be on the left as opposed to the right. Can someone help me please?
That cannot be done using the Html helper alone since it always places it on the right. As stated in this link: http://www.telerik.com/forums/checkbox-label-before-checkbox-input
The Kendo UI checkbox styling requires the rendering to have first the
checkbox, then the label tag, so that the latter can be styled, based
on the checkbox state
To get it on the left, you can omit the label from the helper and add the labelling element to your page separately before it, for example:
<label for="#Model.IsActive">Active:</label>
#(Html.Kendo().CheckBoxFor(m => m.IsActive))

In angular-ui-bootstrap's typeahead, how can I use a custom popup template AND custom item template?

Using https://angular-ui.github.io/bootstrap/ typeaheads
It doesn't look like I'm able to add a custom popup template AND a custom item template.
I've tried changing this in my custom popup:
<div uib-typeahead-match index="$index" match="match" query="query" typeahead-template-url="app/components/localIntentsPicker/typeahead-item.html"></div>
I can remove this div and just add my own changes in-line, but then I lose keyboard control over typeahead selection.
I've also tried adding the following to my main typeahead input.
typeahead-template-url="app/components/localIntentsPicker/typeahead-li.html
Neither seems to work.
Turns out I was doing a few things wrong.
Item template code needs to be wrapped in <a> to maintain keyboard selection.
Most importantly, wrapping template-url in extra quotes fixed the issue:
<div uib-typeahead-match index="$index" match="match" query="query" template-url="'app/components/localIntentsPicker/typeahead-item.html'"></div>

Catching the name of a button during post

If I have an <input> of type submit, with a name, I can catch that name in my MVC model when I use it to post. Is the same not possible with a <button>, of type submit and the same name?
If I use for example name="ButtonName", my property ButtonName get's the input's value. For some reason this doesn't work with a button element.
The reason I want to use a button instead of input, is that i need to have more than text inside the button (including a picture).
You could set the value of the hidden input by using a simple onclick Javascript function for each of your inputs.
function setHidden(sender){
document.getElementById("hidden1").value = sender.value;
}

Custom field is unable to appear in issue view screen

I've created a jira custom field plugin to appear at issue view screen only (as there will be predeined calcualtion on field description-javascript).
But this does not appear at issue view screen what i need even though, assgined hard coded values in vm file.
when create "edit.vm" then it appears on edit issue screen and after assigning the value to field , it could appear in issue view screen but, without edit template , its not working and unable to see in issue view screen.
Below is atlassina-plugin xml stuff:
<customfield-type name="Summary field" i18n-name-key="cascading-summary-field.name" key="cascading-summary-field" class="com.company.plugins.jira.customfields.CascadingSummaryCustomField">
<description key="cascading-summary-field.description">The cascading summary field to allow multiple summary fields using five text box and description javascript to write related text to appear in summary field.</description>
View template as below: (with hard coded value specified though unable to appear this on issue view screen).
<span>$<input type="text" name="${customField.id}:input1" id="${customField.id}:input1" value="#if($input1)$input1#end" style="border: 0px;width:59px;margin-left:1px;"/></span>
<span>$</text><input type="text" name="${customField.id}:input2" id="${customField.id}:input2" value="3" style="border: 0px;width:59px;margin-left:1px;"/></span>
<span>$</text><input type="text" name="3" id="${customField.id}:input3" value="0" style="border: 0px;width:59px;margin-left:1px;"/></span>
//also, tried by just keeping <span>some value</span>
how it could resolve ?
As found, field to appear at view screen, there must have require "Edit" template.
so, it resolved by creating an edit template.
Other wise, have to follow achieve by preparing dynamic object through jquery under CUSTOM FIELD'S description field. (first found, related position to append through firebug and append that created object inside "Custom field >> description".
Thanks

angularjs same textarea to edit multiple elements

I have this case where I set a current item from a list and I need to use a textarea to edit that element's value.
Because of some constraints I have to use a keyup event but I don't think that's a problem.
Check this fiddle: http://jsfiddle.net/terebentina/Euj2C/
click on first/second buttons - it works, it changes the text in the textarea to the value of each element.
change the text in the textarea to something
click on the first/second buttons again - the textarea is not updated anymore. If you look in console, you can see that it switches between the elements, it's just that the textarea is not updated anymore.
Any suggestions? this is driving me nuts!
I know there is a better way modifying your directive to do this but as a quick fix for now you can try binding your textarea to a ngModel value that is just a copy of the current text in the selected element:
<textarea keyup="" ng-model="keyupText"></textarea>
With this in as your current function:
$scope.current = function(idx) {
$scope.current_element = $scope.elements[idx];
$scope.keyupText = $scope.current_element.value;
console.log('current is', $scope.current_element.value);
}
See this fiddle for an example.

Resources