jquery autonumeric plugin: want to get null from blank fields, but it gets auto-filled with zeros - jquery-plugins

The "autoNumeric" plugin fills the input fields with zeros as soon as the field got focused or even hovered over. I want to let end user leave some fields blank. Blank is not the same as zero. Is there any solution?

Check the documentation for the emptyInputBehavior option in the AutoNumericOptions.js file:
/* Defines what should be displayed in the element if the raw value is an empty string ('').
* - 'focus' : The currency sign is displayed when the input receives focus (default)
* - 'press' : The currency sign is displayed whenever a key is being pressed
* - 'always' : The currency sign is always displayed
* - 'zero' : A zero is displayed ('rounded' with or without a currency sign) if the input has no value on focus out
* - 'null' : When the element is empty, the `rawValue` and the element value/text is set to `null`. This also allows to set the value to `null` using `anElement.set(null)`.
*/
emptyInputBehavior: {
null : 'null',
focus : 'focus',
press : 'press',
always: 'always',
zero : 'zero',
},
What you want is to set emptyInputBehavior to 'focus' (which is the default), and you won't get any 'zero' added to your input.
This is with the version v4 in next.

In my usecase, setting the emptyInputBehavior to 'null' worked:
emptyInputBehavior: 'null'
That way, when the input field is emptied, its value is set to null.

Related

Input Value is not getting updated when state object is set to undefined

I have list of options (radio button) and on selection of each option, it will display some input fields to take value from user. These values are stored in state "Dimensions". On option change, I am resetting the dimension object to undefined. But this is value is not getting updated in the input field and it is taking old values.
Text field:
<input value={dimensions ? dimensions[opt?.value?]: undefined}/>
On Option Change Method:
const handleOptionChange = (e: any) => {
setDimensions(undefined);
};
Can anybody please guide me through this.
Thanks inadvance!
In ReactJS, input value should always be defined, even if it is an empty string
<input value={dimensions ? dimensions[opt?.value?]: ''}/>

ngModel - delete last character

i am using mat-radio-group to bind my data. here data & value are same. which means i have 4 value binded and all 4 value are same. So to differentiate the radio buttons i added index as last value for every radio button.
Now i want to fetch this radio button value into my typescript and also eliminate the lastcharacter(which is index). so i use ngModel & ngModelChange.
I can get the output. but the `mat-radio-button' is not selecting
Here is my code
`
<mat-radio-group class="radioButtonAxis" [(ngModel)]="ngM_Fax" (ngModelChange)="onFaxChange($event)">
<mat-radio-button *ngFor='let data of resultSet;index as i' [value]='data.Fax+i'>{{data.Fax}}</mat-radio-button>
</mat-radio-group>
onFaxChange(value){
this.ngM_Fax = value.substring(0, value.length - 1);
}
`
expecting your help on this.
You are using ngModel wrong. The right value is always in this.ngM_Fax, but it has to match 100% [value]. If you want to use the variable without the index, i would suggest to use an extra variable.
Here is a working StackBlitz.

SRRS how to check if there is a certain value in dataset

I am trying to make a new ssrs report:
There is a details group that prints lines from datasource detailsDS.
I also want to make a textbox in the footer(or anywhere, doesn't matter) where if there was any(or more than one) line in detailDS with value that equals "Red" that textbox should be set invisible.
I already tried:
iif(first(Fields!Color.Value, "detailsDS") = "Red", True, false)
of course this doesn't work because it only searches for first record and textbox is out of scope of details.
Is it possible to solve this in report layer?
EDIT:
Seems like lookup function is not supported for ms dynamics.
As B.Seberie noted, you could use the lookup function.
=IIF(Lookup("Red", Fields!Color.Value, Fields!Color.Value, "detailsDS") = "Red", True, False)
You would want to use your static value of "Red" for the first argument. This is the value that will be searched for.
The second argument is for the field in the dataset that you want to check for the first argument's (Arg1) value.
The third argument (Arg3) is the field to return when it finds Arg1 in Arg2 - in this case you can just use the same color field. If the color is found, it will be TRUE otherwise it will be FALSE.

using an expression to show or hide rectangle based on a parameter value (SSRS)

Trying to show/hide a couple of rectangles in SSRS based on an expression which uses the value of a parameter in the report. See the screenshots for more details. When the '-Cover pages' label is picked I want it to display the rectangle but I consistently get the following errors. It can't seem to convert and read the parameter expression no matter what I do.
The expression I'm trying to use is:
=iif(Parameters!specparam.Value="-Cover Pages",true,false)
It looks like the label of your parameter is what you're looking for based on the image provided and your expression. Try to switch instead to:
=IIF(Parameters!specparam.Label="-Cover Pages",TRUE,FALSE)
(Note: I switched specparam.Value to specparam.Label.
Your comment is very close. Apply this expression to the Hidden property of the rectangle:
=IIF( Parameters!specparam.Label.Equals("-Cover Pages"), FALSE, TRUE )
You'll notice I have switched around the FALSE and TRUE as you don't want the rectangle to hide when the parameter matches.
Edit:
As you're dealing with a multivalue parameter, you can use a combination of Array.IndexOf and Split to check if your value is one of the selected parameters.
Apply this expression to the Hidden property of your rectangle:
=IIF( Array.IndexOf( Split( Parameters!specparam.Value, "," ), "-Cover Pages" ) > -1, FALSE, TRUE )

How to set in Report the TextBox visibility by expression in VisualStudio?

I have a simple TextBox in my Precision Design related to a Field in Temporary Table.
I need to show this TextBox only If the it value under Temporary Table is pupulated : so if the value field is pupulated (is a string) I show the Text Box , otherwise I don't show the text Box.
I need to set Visibility by Expression :
Which is the best way forward over ?
Thanks!
You can use iif function. Press fx button, here you can writte your code.
iif function evaluate a condition and return 1 of 2 options, for example, in your case you need show one value only if exist.
check this code:
=iif(fields!YourFieldName.value = "", true, false)
if your field is a number
=iif(fields!YourFieldName.value = 0, true, false)
This code evaluate the value of your field and only populate the value if is complete.

Resources