Vue input cursor move to end after set value - vue.js

I need an input with custom formatter currency by using computed writable. But i have a tiny issue, if insert new number in the middle (like 123,000 => 1,231,000),the cursor of input move to the end.
Expect: I want the cursor keep old position.
Demo question

Related

PENTAHO-CONNECTION VARIABLES

How can i pass database connection details as parameter/variable, using set variables.
Thank you for your help
You may want to look into the below steps and official documents:
To set a variable using Spoon:
In Spoon, select Edit > Edit the kettle.properties file.
In the Kettle Properties window, modify the variable value.
If you want to add a variable, complete these steps.
Right-click on a line number, then select Insert before this row or Insert after this row.
Enter the variable name and value.
If you want to reposition the variable, right-click on the row number again, then select Move Up or Move Down.
Click the OK button.
Add your database properties using the above step.
To Access the variable in your transformation or jobs:
The Get Variable and Get Session Variables steps can explicitly retrieve a value from a variable.
${VARIABLE}
%%VARIABLE%%

vuejs dynamic input collection with wrong values

I am dynamically adding inputs of type text to a vuex collection. It adds the input at specific index. It works good, no problem with that. The issue happens when I write some value in the input and then try to add a new one. The input value jumps to the newly added input.
Here is a simple code example: https://codesandbox.io/s/0yrzrw6120
Steps to reproduce:
There is a default input. You can add inputs below that, so:
Add a new input.
Write some value in the newly added input.
Add a new input again from the default button.
What I am expecting is a new input below default with no value in it, and it works but the value of the last input jumps to the newly added.
I understand is not a problem with the additions of items but the value in the inputs.

Go to the Beginning of String in "System.Windows.Forms.TextBox" - VB.Net

I have an application written in VB.Net where I call a dialog window that lets a user select a file or folder to copy. In that window I have text pre-populated in the file name field as an informational type of message to the user. However the text is so long that it only shows the last bit of it, so I need a way to reset the cursor position to the first character in the string. I also have the text highlighted by default so that the user can just begin typing to overwrite it. Here's what I have so far-
pushLocationBox1.SelectAll()
cursorPosition = pushLocationBox1.SelectionStart
I think the "cursorPosition = pushLocationBox1.SelectionStart" is a good start at getting the location I need to point the cursor to, but I'm not sure where to go from there.
Thanks in advance.

BIRT result set values in specific cells

My query returns location_cd(string) and item_count(int). I only need certain rows from the result however and I need them to display in specific places in my layout so I don't think the table solution is going to work. Can I determine where I place the value for a particular row of the result set?
I am using a grid to display values for a number of fields. I cannot seem to be able to get the values from the results to show. The grid is bound to the result set. I even tried binding the cells to the result set but that didn't work either.
I checked in the query editor and there is a result set shown in the Preview so I know the query works. The complete and correct result set shows if I put a table on the page.
I tried inserting a Dynamic Text or Data object in a cell and used the expression:
dataSetRow["location_cd"]=="3SD"?dataSetRow["item_count"]:""
This returns a blank and does not seem to evaluate. I tested it with :
dataSetRow["location_cd"]=="3SD"?dataSetRow["item_count"]:"BLANK"
and got 'BLANK' to appear in that cell.
dataSetRow["location_cd"] and dataSetRow["item_count"] will display the location_cd and item_count from the first row of the result set. row.outer[] did the same thing. Obviously I am just hacking at this report at this point.
A co-worker suggested that she uses a JAVA if-statement in places like this but I could not get that to work either.
Any ideas or suggestions that will get me on the right road??
Thanks
An elegant option would be to use a HashMap storing the result of the dataset.
Declare a report variable named "values", with a new hashmap as default value (see image below)
Fill values in the onFetch script of the dataset: vars["values"].put(row["location_cd"],row["item_count"]);
Insert new data elements at any place of the report with expressions such: vars["values"].get("myFavoriteLocationCD");
Though it is important to note the dataset should be triggered by the report before these data elements.
The particular row you want to display you specify in a "Text" field inside your grid. Just drag and drop a "Text" field inside your grid. If you bound the fields you want to display to your grid, the "Text" field inside the grid inherits the bindings of its parent (the grid), so you can access the bindings automatically in the "Text" field.
You could try following steps, maybe that works.
Don't use "Dynamic Text" field, instead use a regular "Text" field
Ensure the fields of your query which you use, are bound to the grid (you sayed you already did)
Open the "Text" field
Change preselected pull-down entry "Auto" into "HTML"
Change preselected pull-down entry "Formatting" into "Dynamic Text"
Wrap your code in <value-of format="HTML"> your code goes here... </value-of>
Note: You should check in the "Expression Builder" of your "Text" field if you are able to access the fields you bound to the grid. If they are not available sth. went wrong with your binding. Avoid binding query records to cells this will drive you crazy.
If you want to display a list, ensure you didn't set a constant height in the row of your grid. Set the height to 100% than the row takes its height dynamically.
What about the idea to optimize your query, that only get the results you want are displayed, than you don’t need to filter them with java script? If you don’t need the filtered results in another place this would be the cleaner solution in my opinion.

Variable's value doesn't change in coffeescript when using onclick

I have the following Coffeescript code:
for name, data of statistics
row = document.createElement 'tr'
row.onclick = ->
alert name
However, when I compile and run it (in the context of a large webpage), it alerts the same name, no matter what row I click on. It seems to be remembering the variable, as if it's constant.
What am I doing wrong?
EDIT:
I've discovered the issue, but I'm not sure how to go about fixing it: Javascript/Coffeescript does not evaluate the 'name' variable until the end of the loop is reached.
The functions that you are defining (and assigning to the row's onclick attribute) all have access to the same variable outside that function (name). At the end of the loop, name has one value (the last item in the loop, as you mention), so each of the onclick functions alerts that value.
You can fix this by binding 'name' to a value that doesn't change. This question presents one solution. This question has some useful background that's worth reading.