Как скрыть интервал переноса (входной) и показать диапазон ниже? - PullRequest
0 голосов
/ 12 октября 2018

Пожалуйста, посмотрите на скриншот:

enter image description here

Мы используем Kendo UI и JQuery.Код выглядит следующим образом:

1) Для подсвеченной ячейки, в которой мы используем NumericTextBox:

this.addChild("netSum", new ui.NumericTextBox($(`input[name='row.netSum${this.suffix}']`, this.fn), { tag: "netSum", binder: ui.bindTo(this.options.data, "netSum"), minValue: this.getMinValue(), text: "" }));

2) В файле .cshtml:

<script id="billGridTotalRowTemplate" type="text/x-jsrender">
  <tr class="invoice-totals">
    <td colspan="2" class="first"><i class="uicon-plus txt-success"></i><a href="#" class="alt add-row block-inline">Добавить строку</a></td>
    <td colspan="2"><span class="txt-table">Всего к оплате</span></td>
    <td>
      <input name="netsum" type="text" />
      <span id="netSumFake" class="txt-table">test</span>
    </td>
    <td></td>
    <td>
      <input name="vatsum" type="text" />
    </td>
    <td>
      <input name="totalsum" type="text" />
    </td>
    <td class="last"></td>
  </tr>
</script>

3)NumericTextBox:

(function () {
    function numericTextBox() {
        numericTextBox.superclass.constructor.apply(this, arguments);
        this.params = $.extend(true, {
            val: null,
            minValue: null,
            maxValue: null,
            digits: 2,
            groupSize: 3,
            step: 1,
            negative: 1,
            spinners: false,
            text: "",
            inputAttributes: { maxlength: 17 },
            format: "n"
        }, this.params);
        this.tControl = this.fn.kendoNumericTextBox({
            change: $.proxy(this.onChange, this),
            type: "numeric",
            min: this.params.minValue,
            max: this.params.maxValue,
            decimals: this.params.digits,
            groupSize: this.params.groupSize,
            step: this.params.step,
            negative: this.params.negative,
            spinners: this.params.spinners,
            text: this.params.text,
            inputAttributes: this.params.inputAttributes,
            format: this.params.format
        }).data("kendoNumericTextBox");
    }

    extend(numericTextBox, ui.WrappedControl);

    numericTextBox.prototype.disable = function () {
        this.fn.hide();
        this.fn.next(".txt-table").show();
    };

    ui.NumericTextBox = numericTextBox;
})();

Мы хотим скрыть 'input' с именем 'netsum' и показать 'span' с id 'netSumFake'.

Вызов методов jQuery hide () и show() не работает.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...