|
51 | 51 | <span v-if="!column.editable"> {{ entry[column.name] }} </span>
|
52 | 52 | <value-field-section v-else
|
53 | 53 | :entry="entry"
|
54 |
| - :columnname="column.name" |
55 |
| - :value="entry[column.name]"></value-field-section> |
| 54 | + :columnname="column.name"></value-field-section> |
56 | 55 | </td>
|
57 | 56 | </tr>
|
58 | 57 | </tbody>
|
|
186 | 185 |
|
187 | 186 | /* Field Section used for displaying and editing value of cell */
|
188 | 187 | var valueFieldSection = {
|
189 |
| - template: '<span v-if="!enabled" @dblclick="toggleInput" class="editableField"> {{ value }} </span>'+ |
| 188 | + template: '<span v-if="!enabled" @dblclick="toggleInput" class="editableField">{{this.entry[this.columnname]}}</span>'+ |
190 | 189 | '<div v-if="enabled" class="input-group">'+
|
191 |
| - ' <input type="text" class="form-control" v-model="value" @keyup.enter="saveThis" @keyup.esc="cancelThis">'+ |
| 190 | + ' <input type="text" class="form-control" v-model="datavalue" @keyup.enter="saveThis" @keyup.esc="cancelThis">'+ |
192 | 191 | ' <span class="input-group-btn">'+
|
193 | 192 | ' <button class="btn btn-danger" type="button" @click="cancelThis" ><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button>'+
|
194 | 193 | ' <button class="btn btn-primary" type="button" @click="saveThis" ><span class="glyphicon glyphicon-ok" aria-hidden="true"></span></button>'+
|
195 | 194 | ' </span>'+
|
196 | 195 | '</div>',
|
197 |
| - props: ['entry','value','columnname'], |
| 196 | + props: ['entry','columnname'], |
198 | 197 | data: function () {
|
199 | 198 | return {
|
200 |
| - enabled: false, |
| 199 | + enabled: false, |
| 200 | + datavalue: "", |
201 | 201 | }
|
202 | 202 | },
|
203 | 203 | methods: {
|
204 | 204 | saveThis: function () {
|
205 | 205 | var originalValue = this.entry[this.columnname];
|
206 |
| - this.entry[this.columnname] = this.value; |
207 |
| - this.$dispatch('cellDataModifiedEvent', originalValue, this.value, this.columnname, this.entry); |
| 206 | + this.entry[this.columnname] = this.datavalue; |
| 207 | + this.$dispatch('cellDataModifiedEvent', originalValue, this.datavalue, this.columnname, this.entry); |
208 | 208 | this.enabled = !this.enabled;
|
209 | 209 | },
|
210 | 210 | cancelThis: function () {
|
211 |
| - this.value = this.entry[this.column-name]; |
| 211 | + this.datavalue = this.entry[this.columnname]; |
212 | 212 | this.enabled = !this.enabled;
|
213 | 213 | },
|
214 | 214 | toggleInput: function () {
|
| 215 | + this.datavalue= this.entry[this.columnname]; |
215 | 216 | this.enabled=!this.enabled;
|
216 | 217 | },
|
217 | 218 | }
|
|
0 commit comments