Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.45 KB | None | 0 0
  1. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  2. <%@ page contentType="text/html" isELIgnored="false" %>
  3. <c:out value="${packetPortletMessage}" />
  4. <div id="mainDiv"></div>
  5.  
  6. <?xml version="1.0" encoding="UTF-8"?>
  7. <!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 6.0.0//EN"
  8.  
  9. "http://www.liferay.com/dtd/liferay-portlet-app_6_0_0.dtd">
  10. <liferay-portlet-app>
  11. <portlet>
  12. <portlet-name>packetPortlet</portlet-name>
  13. <instanceable>true</instanceable>
  14. <remoteable>true</remoteable>
  15. <header-portlet-css>/js/ext-4.2/resources/css/ext-all.css</header-portlet-css>
  16. <header-portlet-javascript>/js/ext-4.2/ext-all-debug-w-comments.js</header-portlet-
  17. javascript>
  18. <header-portlet-javascript>/js/app.js</header-portlet-javascript>
  19. </portlet>
  20. </liferay-portlet-app>
  21.  
  22. Ext.onReady( function () {
  23. alert("I am an alert box!");
  24. });`
  25.  
  26. Ext.require([
  27. 'Ext.grid.*',
  28. 'Ext.data.*',
  29. 'Ext.util.*',
  30. 'Ext.state.*',
  31. 'Ext.selection.CellModel',
  32. 'Ext.grid.*',
  33. 'Ext.form.*',
  34. 'Ext.ux.CheckColumn'
  35. ]);
  36. Ext.onReady( function () {
  37. Ext.QuickTips.init();
  38. // setup the state provider, all state information will be saved to a cookie
  39. Ext.state.Manager.setProvider(Ext.create('Ext.state.CookieProvider'));
  40. var divId = Ext.get("mainDiv");
  41. Ext.define('comptmodel', {
  42. extend: 'Ext.data.Model',
  43. fields: [
  44. {name: 'id', type: 'int'},
  45. {name: 'label', type: 'string'},
  46. {name: 'packageIdFk', type: 'int'},
  47. {name: 'preVal', type: 'string'},
  48. {name: 'inVal', type: 'string'},
  49. {name: 'finalVal', type: 'string'}
  50. ]
  51. });
  52. var store = Ext.define('comptstore', {
  53. extend: 'Ext.data.Store',
  54. model: 'comptmodel',
  55. autoLoad: true,
  56. pageSize: 35,
  57. proxy: {
  58. type: 'ajax',
  59. url: 'data.json',
  60. reader: {
  61. type: 'json',
  62. root: 'components',
  63. id: 'idProperty',
  64. successProperty: 'meta.success'
  65. }
  66. }
  67. });
  68. var gridColumns = [
  69. {
  70. header: 'Label',
  71. dataIndex: 'label',
  72. flex: 1,
  73. sortable: false,
  74. id: 'label'
  75. },
  76. {
  77. header: 'Pre Commitee',
  78. dataIndex: 'preVal',
  79. sortable: true,
  80. width: 130,
  81. id: 'preVal'
  82. },
  83. {
  84. header: 'In Commiteee',
  85. dataIndex: 'inVal',
  86. width: 130,
  87. id: 'inVal'
  88. },
  89. {
  90. header: 'Final',
  91. dataIndex: 'finalVal',
  92. width: 130,
  93. id: 'finalVal'
  94. }
  95. ];
  96. var grid = Ext.create('Ext.grid.Panel', {
  97. store: store,
  98. stateful: true,
  99. stateId: 'stateGrid',
  100. columns: gridColumns,
  101. height: 350,
  102. width: 600,
  103. title: 'Array Grid',
  104. renderTo: divId,
  105. viewConfig: {
  106. stripeRows: true
  107. },
  108. plugins: [cellEditing]
  109. });
  110.  
  111. <link rel="stylesheet" href="resources/css/ext-all.css"/>
  112. <script type="application/javascript" src="ext-all-debug-w-comments.js"></script>
  113. <script type="application/javascript" src="app4.js" ></script>
  114.  
  115. <header-portlet-css>/js/ext-4.2/resources/css/ext-all.css</header-portlet-css>
  116. <header-portlet-javascript>/js/ext-4.2/ext-all-debug-w-comments.js</header-portlet-
  117. javascript>
  118. <header-portlet-javascript>/js/app.js</header-portlet-javascript>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement