I am using CKeditor and this code is for a button. I store xml in Dom. I am trying to use the xml in the other function for a select box. The select box's code is similar with this button code. when I hit a list in the select box, i want to see the word between <chr>
and </chr>
. I do not want to put <chr>
in a option.
type: 'button',
id: 'btnFind',
align: 'left',
style: 'width:100%',
label: 'add',
onClick: function () {
var y = this.getDialog();
var value1 = y.getValueOf('replace', 'chgWord');
var value2 = y.getValueOf('replace', 'title');
var xml = "<channel><title>" + value1 + "</title><chr>" + value2 + "</chr></channel>",
xmlDoc = $.parseXML(xml),
$xml = $(xmlDoc),
$title = $xml.find("title");
$("#cke_119_select").append("<option value='" + $title.text() + "'>" + $title.text() + "</option>");
$title = $xml.find("chr");
this is a code for selecbox:
type: 'hbox',
widths: ['200px', '90px'],
children: [{
type: 'select',
label: '약어 LIST :',
size: 5,
style: 'width:100%',
labelLayout: 'horizontal',
id: 'list',
items: [],
onClick: function () {
selValue = $("#cke_119_select option:selected").val();
selText = $("#cke_119_select option:selected").text();
selIndex = $("#cke_119_select option").index($("#cke_119_select option:selected"));
selBox = $("#cke_119_select");
selOption = selBox.attr("options");
var y = this.getDialog();
var value1 = y.setValueOf('replace', 'chgWord');
value1.setValue(selValue);