Issue using extjs to display text containing double quotes - javascript

I am using extjs to display my data from database in which records also contain some special characters. When I am displaying the records, each record has a drop down field which shows the values containing specials characters. It shows those values with hex code of those special characters like:
Value coming from server like "Rohit's, Kumar" which is correct I think but initially extjs is showing it but when I save a row and then go to update that row again, now the drop down shows some value like this:
"Rohit"s, Kumar"
Which is the wrong behavior. How do you prevent this in extjs?

Related

Extjs tagfield saving values in inputbox

This is the first time I am working on ExtJs. I am trying to create a tagfield with all selection stored in the inputfield as values.
Right now I think all the values are saved as the <li></li> tags.
Is there a way I could save selection as csv in the value attribute to the field ?
I want to change the template to parse CSV values and select the items in the dropdown.
If you want to submit a different data format during form submission, you have to override the getSubmitData function of the tagfield.
I have made an example for you - not with CSV, but with the array encoded as JSON:
Relevant fiddle

How to resolve unicode issue with javascript length?

I have angular tooltip for character counter but here i am facing some issues when user copy paste text and add some ascii characters that are not aligned with the java and orcale length when we post the data to the backend, Lets say if user have # in the text it will count lenght as 1 but backend side it will count as 4 because of the way oracle and java works with bytes.
So i am trying to resolve two issues.
1- when i paste text it character counter should count same unicode as java ?
2- It should not remove characters from the text ?
main.html
<textarea rows="2" class="form-control"
ng-model="processDTO.processStatementText"
name="processStatement" id="processStatement"
placeholder="Process Statement" maxlength="4000" required
data-tooltip-html-unsafe="<div>{{4000 - processDTO.processStatementText.length}} characters left</div>"
tooltip-trigger="{{{true: 'focus', false: 'never'}[processDTO.processStatementText.length >= 0 || processDTO.processStatementText.length == null ]}}"
tooltip-placement="top" tooltip-class="bluefill">
</textarea>
main.txt
2. Upload Template Header – Risk Causal and Impact comments are color coded as mandatory but they are optional. Similary the Originating Source System Process/Risk/control ID
3. In the upload template, for any of the multi value fields, I use an invalid delimiter ‘:’, Eg: 13:7 , for some reason this changes the cell format to time format and thereafter I am not able to give any single values, its always converted to time format. Not sure if this is a training issue, but want to put it on the table to see if it requires any fix at all
4. In Upload, for the grid field length validations, the filter doesn’t works on Row Number and Max Allowed columns. ~!##$%^&*()_+|}{:"?><,./';[]\=-0987654321`
5. ERH All levels added in the View End to End ERH screen – Sort and Filter doesn’t works, After clicking on this field, none of the other filter/sort works on the page. Also the sort indicator(black triangle) is not visible, I believe the column width needs to be adjusted.
6. The Risk/Control reference id is seen on the Process Search grids, but when I search by Risk/Control, I don’t see the corresponding control/risk grid having the ref id column however tool tip has it
7. The label change “Originating Source System Process/Risk/Control ID”"

select options are not being shown using d3.js?

I am trying to show the names of few detectors in a combobox using d3.js. I used the following code to show the data.
d3.csv("Results_New.txt", function(data) {
//var data = d3.csv.parseRows(datatext);
d3.select("#road").selectAll("option")
.data(data).enter().append("option").text(function(d){return d.detector-id;}).attr("value",function(d){return d.detector-id;});
But the values are not being shown in the output combobox. Rather the combox options are showing blank space. Can anyone give me the idea how can the values be shown? Is it mandatory to put the combobox within a SVG?
I'm guessing your column in your csv file is named "detector-id"?
d.detector-id is not valid. That's translated as object variable d with property detector minus variable id.
Use return d["detector-id"]; instead.
Here's working code.
Is it mandatory to put the combobox within a SVG?
You actually aren't putting a combobox box in SVG. What I think you mean is "is it mandatory to build the combobox with d3?" The answer is no.

Retaining changes made using Javascript to the page

I have a page which is having 2 tabs.
On first tab i have a table which contains some 'n' rows.
Each row is having a text box and depending on value entered in that text box, values in other cells for that row are calculated using JavaScript.
Now the problem is whenever i am moving to second tab after updating the text boxes and again coming back to first tab, then the values which are calculated using JavaScript are not retained whereas values entered in text box are retained.
How to retain those calculated values?
I would either re-trigger the javascript that does these calculations in an onblur event handler, or store the calculated values in cookies/session.
You could store this data in a cookie - this type of thing is exactly what they're for.

Auto Complete Fields in Rails that Display Something Different Than What They Select

I'm trying to create an auto complete field (using the script.aculo.us plugin) in a form for a category select, but I want the auto complete list to display a number next to each category (the number of other things in the same category). This is similar to the Tags field on stack overflow.
Right now I can display the number I want, but when I select any field the extra number gets dumped into the text field with the category. Currently I'm simply appending the number to each item on the array before I display it. How can I make it so when you select something from the list the number (enclosed in parentheses) does not get put into the text field. Thank you.
I finally solved my problem, I just needed to figure out what some of the plugin's options were. It turns out there is an option for the auto_complete_field helper called :select. The value you provide to this tells the JavaScript which part of the <li> element (the HTML tags the results are displayed in) to return to the text box.
The solution was a simple matter of enclosing the name of the category in a span with a special class and leaving the number part I didn't want outside of this class. This was easy since I was already using my own partial to display the results.

Categories