Change the Text of Button in jqxgrid - jqxgrid

Hi friends is there a way to change the Text of Jqxgrid button??
I have a grid in which i am showing Active Records and In Active Records depending on the selection of a HTML drop down !!
If i select the 'Active' option in HTML drop down i am showing Active Recorders in the grid.
Where as
If i select the 'In Active' in HTML drop down i am showing In Active Recorders in grid.
When i am showing Active Recorders i am showing a button also in grid with text 'Remove' ,
so at the time of Showing In Active recorders this button text should change to 'Add'
Please give me any references or working examples..????

You can choose the name of the button text via the cellsrenderer function like so:
cellsrenderer: function (row, columnfield, value, defaulthtml, columnproperties) {
var rowData = $("#jqxgrid").jqxGrid('getrowdata', row);
if(rowData.productname == 'Cappuccino'){
return "Product Name is Cappuccino";
}else{
return "Not Cappucino";
}
}
http://jsfiddle.net/35kU5/67/

Related

Google sheets, hide/remove data validation dropdown..unless another cell is not empty?

I have a column that has dropdown list with data validation, and its applied infinitely down that column. So I have lots of cells with the little dropdown arrow which is annoying.
Is there a way to remove that dropdown arrow....IF say "Date" or "Name" column is empty?
I want the drop to to show only when I have started inputting data to that row, I will never start with the drop down, I start with date. So ideally, as soon after entering the date, the dropdown arrow appears.
Can that be done? Thanks!
You can remove the dropdown arrows by unchecking Show Dropdown List in Cell on Data Validation dialog:
This will show the dropdown list only when you start entering data to the cell.

Select2 drop-down list is not repositioned to show added tags

I'm using Select2 (version 4.0.2) to allow users to select multiple values and make tags of them. The problem is that when the span holding the tags is expanded after new tags are selected, the drop-down values list area is not repositioned accordingly.
This figure shows the Select2 area containing several previously selected values, prior to selecting additional values:
This figure shows what happens after I select one or more choices, which are hidden because the tags area is taller than it was, but the drop-down options list is stuck in the same position:
If I take focus from (blur) the tag area, the drop-down is re-displayed in the proper position to show all of the currently selected values/tags:
Question
How do I get the drop-down options area to dynamically reposition as new tag values are selected? Can I intercept a Select2 event and somehow force it to recalculate the vertical position? Or perhaps blur() then focus() the span each time a selection is chosen?
The solution I came up with was to force the drop-down element to be resized whenever a drop-down choice was selected or de-selected, which required catching the "change" event:
// Apply Select2 to the <select> element
var select2Elem = $("#" + controlID).select2(opts);
// Force drop-down list to resize upon select/unselect
select2Elem.on("change",
function(evt) {
select2Elem.resize();
}
);

Selection of Popup Button clearing UI Text Field

I've been developing a programming where the user can select a list of fields from popup buttons, then they press a calculate button and then depending on the choices, a string of text gets outputted to a UIText Field.
However I would like for the text field to be cleared when the user starts selecting other choices in the popup button before pressing the select button.
Is there anyway this is possible?
Just right this code in the place where that happens:
/*You can replace theTextFieldYouAreTalkingAbout with the one you are talking about*/
theTextFieldYouAreTalkingAbout.text = ""

Get selected words from Rich-Text box from Add-in

I have a VSTO add-in which has a menu and button. In my infopath form, i have multiple rich-text box which would be edited by user. While editing, if user select a word or sentence in any of the rich-text box and click the button from add-in, i need to add those selected text in a dropdown.
How can i get the selected text from the rich-text box? The selected may be in any one of the available rich text box, so i need to know the context to identify the rich-text box and then get only the selected text.
In your btn_Clicked event, try this code. It should grab the text starting where the mouse is and ending at the end of the current block.
var curCaret = richTextBox1.CaretPosition;
var curBlock = richTextBox1.Document.Blocks.Where(x => x.ContentStart.CompareTo(curCaret) == -1 && x.ContentEnd.CompareTo(curCaret) == 1).FirstOrDefault();

How to create Combobox with multiselect capability?

How to create a Combobox having Multiselect Capability using Jquery?
Does JQuery Combobox has this functionality or Property?
if it helps, take a look http://ivaynberg.github.io/select2/ for multi select values
Edited : I found one more link it's really great http://tameraydin.github.io/jquery-easyselect/
Combobox displays the selected value when its list of options is collapsed. You may want to use multiple selection list.
to use multiple select in combobox you will have to create your own user control using checked listbox, textbox and a button.
and on click of button just make checked list box visible and let the user select items from that checkedListBox and as user select items on it you take those values and concatenate it in textbox with comma seperated. and then again on click on button hide that list box.
as it is on : http://9perhour.co.uk/
which is asking for select technology
some good samples
for jquery:
http://abeautifulsite.net/blog/2008/04/jquery-multiselect/
http://quasipartikel.at/multiselect/
http://www.codeproject.com/KB/ajax/jqueryajax.aspx
for asp.net:
http://www.codeproject.com/KB/user-controls/MultipleSelectionDropDown.aspx
http://www.codeproject.com/KB/webforms/DataGridDropDownList.aspx
http://www.codeproject.com/KB/asp/multiselectdropdown.aspx

Resources