質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.49%
PHP

PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

CodeIgniter

CodeIgniterは、PHP向けオープンソースのWebアプリケーションフレームワークです。CodeIgniterは覚える構文が少なく、自由度も高いため、PHPを理解していれば構築が簡単です。

Q&A

0回答

1708閲覧

Handsonetableのマッピングについて

komachi3

総合スコア6

PHP

PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

CodeIgniter

CodeIgniterは、PHP向けオープンソースのWebアプリケーションフレームワークです。CodeIgniterは覚える構文が少なく、自由度も高いため、PHPを理解していれば構築が簡単です。

0グッド

1クリップ

投稿2018/05/28 05:20

編集2018/05/28 06:32

ここに質問の内容を詳しく書いてください。
PHP(codeigniter)でシステム改修しています。
今回初めてHandsontableを使ってテーブルを改修しているのですが、カラム数を変更するとマッピングが上手くいっていないのか、
違うHandsontableのテーブルの数値が変化してしまいます。
ご教授の方、宜しくお願い致します。

発生している問題・エラーメッセージ

handsome tableにてカラム数を変更すると他のHandsontableのテーブルの数値が実現したい事に反して変化してしまいます。

エラーは出ておりませんが、ステップアップでデバッグすると途中まで実現通りの数値が入るのですが、
途中で0に変更してしまいます。

該当のソースコード

PHP Version 5.6.31 <script type="text/javascript"> $(document).ready(function() { boxInitial(); // Total amountの計算 calcTotal(); calcTotalAmount(); <?php if(isset($forcePdf) && $hasEnabledItem): // PDFの強制ダウンロードフラグがあれば処理する ?> location.href = '<?php echo site_url("order_edit/outputPdf") ?>/{order_number}/{forcePdf}'; <?php endif; ?> }); var fraction_type = <?php echo json_encode($fraction_type, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT); ?>; var total = <?php echo json_encode($total, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT); ?>; var detail = <?php echo json_encode($detail, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT); ?>; var change_flg = false; var detailNumber = [<?php echo implode(',', array_column($detail, 'detail_number')); ?>]; // 集計テーブル初期化 var totalTable = document.getElementById('totalTable'); var hot1 = new Handsontable(totalTable, { minCols: 10, minRows: 1, startCols: 10, startRows: 1, fillHandle: false, width: 1150, height: 80, wordWrap: true, colHeaders: true, enterBeginsEditing: false, colHeaders: ['Item qty', 'Total qty', 'Total arrival qty', 'Total retail price', 'Total item amount', 'Total charges', 'Fuel surcharge', 'Insurance', 'Discount', 'Total amount'], undo: false, data: total, columns: [ // ★列のマッピングと列関連の定義 {data: 'item_qty' ,type: 'numeric', readOnly: true, className: 'htReadOnly'}, {data: 'total_qty' ,type: 'numeric', readOnly: true, className: 'htReadOnly'}, {data: 'total_arrival_qty' ,type: 'numeric', readOnly: true, className: 'htReadOnly'}, {data: 'total_retail_price' ,type: 'numeric', format: '0,000', readOnly: true, className: 'htReadOnly'}, {data: 'total_item_amount' ,type: 'numeric', format: '0,000', readOnly: true, className: 'htReadOnly'}, {data: 'total_charges' ,type: 'numeric', format: '0,000', readOnly: true, className: 'htReadOnly'}, {data: 'fuel_surcharge' ,type: 'numeric', format: '0,000', readOnly: true, className: 'htReadOnly'}, {data: 'insurance' ,type: 'numeric', format: '0,000'}, {data: 'discount' ,type: 'numeric', format: '0,000'}, {type: 'numeric', readOnly: true, format: '0,000', className: 'htReadOnly'} ], cells: function(row, cols, prop) { var cellProperties = {}; if (cols === 8) { cellProperties.renderer = discountRenderer; } if (total['status'] >= 6){ // 送料入金後は編集不可 switch (cols){ case 7: case 8: return {readOnly : true, className: 'htReadOnly'}; } } return cellProperties; }, // 変更イベント afterChange: function(changes, source){ if(!changes) { return; } // システム内でセットした場合は処理しない if (source == 'system'){ return; } calcTotalAmount(); } }); var detailTable = document.getElementById('detailTable'); var hot2 = new Handsontable(detailTable, { minCols: 12, minRows: 1, startCols: 12, startRows: 1, fillHandle: false, width: 1150, height: 40 + (detail.length * 50), wordWrap: true, rowHeaders: true, colHeaders: true, fixedColumnsLeft: 6, enterBeginsEditing: false, colHeaders: ['JAN<br>Item number', 'Item name<br>Maker/Color', 'Total<br>qty', 'arrival<br>qty','Retail<br> price', 'Rate', 'Unit<br> price(¥)', 'Unit<br> price(fc)', 'Amount(¥)<br>Amount (fc)', 'Delivery<br>date', 'Discontinue', 'Cancel'], colWidths: [150, 220, 60, 70, 70, 60,80, 80, 120, 100,120,100], undo: false, data: detail, columns: [ // ★列のマッピングと列関連の定義 {data: 'z_item_number' ,type: 'text', readOnly: true, className: 'htReadOnly'}, {data: 'z_item_name' ,type: 'text', readOnly: true, className: 'htReadOnly'}, {data: 'order_qty' ,type: 'numeric', readOnly: true, className: 'htReadOnly'}, {data: 'arrival_qty' ,type: 'numeric', readOnly: true, className: 'htReadOnly'}, {data: 'retail_price' ,type: 'numeric', format: '0,000', readOnly: true, className: 'htReadOnly'}, {data: 'rate' ,type: 'numeric'}, {data: 'unit_price_jp' ,type: 'numeric', format: '0,000'}, {data: 'unit_price' ,type: 'numeric', format: '0.99', readOnly: true, className: 'htReadOnly'}, {data: 'z_amount' ,type: 'numeric', format: '0.99', readOnly: true, className: 'htReadOnly'}, {data: 'delivery_date' ,type: 'date', dateFormat: 'YYYY/MM/DD'}, {data: 'discontinue_flag' ,type: 'checkbox', checkedTemplate: '1', uncheckedTemplate: '0', className: 'htCenter'}, {data: 'cancel_flag' ,type: 'checkbox', checkedTemplate: '1', uncheckedTemplate: '0', className: 'htCenter'} ],

試したこと

補足情報(FW/ツールのバージョンなど)

PHP(codeigniter)

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

m.ts10806

2018/05/28 05:55

プログラムコード(およびエラーメッセージ)は質問内容としては最も重要な部分であるため、見やすくしていただけると助かります。<code>ボタン押下→「コード」部分にコードを貼り付け→「ここに言語を入力」に対象言語名記入(エラーメッセージの場合は不要)の手順で「コードハイライト化」してください。(質問編集画面ではリアルタイムでプレビューが表示されるので見ながら調整してください)
komachi3

2018/05/28 06:32

ご指摘ありがとうございます。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.49%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問