Excl очень мощный, и многие встроенные функции или формулы могут значительно улучшить способность обработки данных. Так есть ли в Интернете аналогичные элементы управления? После некоторого поиска я обнаружил, что Gressontable имеет основные формулы поддержки функций Excel и может редактировать данные в режиме реального времени. Кроме того, он поддерживает копию перетаскивания, Ctrl+C, Ctrl+V и т. Д. С точки зрения поддержки браузера, он поддерживает следующие браузеры: IE7+, FF, Chrome, Safari, Opera.
Во -первых, введены соответствующие библиотечные файлы. Поддержка формулы не включена в HandsOntable.full.js и должна быть введена отдельно:
<script src = "http://handsontable.github.io/handsontable-rulejs/lib/jquery/jquery-1.10.2.js"> </script> <script src = "http://handsontable.github.io/handsontable-rulejs/lib/handsontable/handsontable.full.js"> </script> <link rel = "stylesheet" media = "screen" href = "http://handsontable.github.io/handsontable-rulejs/lib/handsontable/handsontable.full.css"> <script src = "http://handsontable.github.io/handsontable-rulejs/lib/rulejs/lib/lodash/lodash.js"> </script> <script src = "http://handsontable.github.io/handsontable-rulejs/lib/rulejs/lib/underscore.string/underscore.string.js"> </script> <script src = "http://handsontable.github.io/handsontable-rulejs/lib/rulejs/lib/moment/moment.js"> </script> <script src = "http://handsontable.github.io/handsontable-rulejs/lib/rulejs/lib/moment/moment.js"> </script> <script src = "http://handsontable.github.io/handsontable-rulejs/lib/rulejs/lib/numeral/numeral.js"> </script> <script src = "http://handsontable.github.io/handsontable-rulejs/lib/rulejs/lib/numericjs/numeric.js"> </script> <script src = "http://handsontable.github.io/handsontable-rulejs/lib/rulejs/lib/js-md5/md5.js"> </script> <script src = "http://handsontable.github.io/handsontable-rulejs/lib/rulejs/lib/js-md5/md5.js"> </script> <script src = "http://handsontable.github.io/handsontable-rulejs/lib/rulejs/lib/jstat/jstat.js"> </script> <script src = "http://handsontable.github.io/handsontable-rulejs/lib/rulejs/lib/parser.js"> </script> <script src = "http://handsontable.github.io/handsontable-rulejs/lib/rulejs/parsser. src = "http://handsontable.github.io/handsontable-rulejs/lib/rulejs/js/parser.js"> </script> <script src = "http://handsontable.github.io/handsontable-rulejs/lib/rulejs/jsrule src = "http://handsontable.github.io/handsontable-rulejs/lib/handsontable/handsontable.formula.js"> </script>
Поместите контейнер для Div в HTML, чтобы хранить симпатичный контроль:
<body> <div id = "handesontable-code"> </div> </body>
В коде JavaScript сначала получите контейнер Div, а затем создайте управление таблицами:
<script type = "text/javascript"> $ (document) .ready (function () {var data1 = [['= $ b $ 2', "maserati", "mazda", "return 1+2;", 'return dataCcess.getScalar ("Select Top 1 имя из Cloud_Users, где CellPhone = 15895211486"); ",", ",", ",", ",", ",", ",", ",", ",", ",". 2941, 4303, 354, 5814], [2010, 5, 2905, 2867, '= сумма (A4, 2, 3)', '= $ b1'], [2011, 4, 2517, 4822, 552, 6127], [2012, '= сумма (A2: A5)', '= sum (b5, e3)' = A2/b2, '= A2/B2,' = A2/B2, '= A2/B2,' = A2/B2, '= A2/B2,' = A2/B2, '= A2/B2,' = A2/B2, '= A2/B2,' = A2/B2/B2, '= A2/B2,' = A2/B2, '= A2/B2,' = A2/B2, '= A2/. 4151]; //cellproperties.readonly = true; // ДАННЫЕ ДАННЫЕ ДАТАТ ДАТАТ: «HTML», // «XML», «HTML», «Скрипт», «JSON», «JSONP», «Текст». $ ("#msg"). html (decodeuri (data)); // hideloAning (); td.appendchild (newvalue); OftionValuerenderer); Getronyble.helper.Stringify (this.Instance.getData () [row] [col]); </script>Формула = сумма (B5, E3) предоставлена правилами. Возврат 1+2 - это сценарий C# Code, реализованный самим собой. Вам нужно нажать, чтобы разобрать:
открытый класс csengine: ihttphandler {private static int count = 0; public void processRequest (контекст httpcontext) {context.response.contenttype = "text/plain"; попробуйте {count ++; string ret = ""; string code = context.request ["code"]. toString (); if (string.isnullorempty (code)) {ret = "ошибка параметра"; } else {scriptoptions options = scriptoptions.default. AddReferences (Assembly.getAsembly (typeof (dbservices.dataaccess))) //.addimports("system.data ") //.addimports("system.data.sqlient"). var state = csharpscript.runasync (code, options) .result.returnvalue; ret = state.toString (); состояние = null; опции = null; } Console.writeline (count); context.response.write (ret); } catch (Exception ex) {// urry console.writeline (count); }} public bool iSreusable {get {return false; }}}Запустите код следующим образом:
Выше всего содержание этой статьи. Я надеюсь, что это будет полезно для каждого обучения, и я надеюсь, что все будут поддерживать Wulin.com больше.