【问题标题】:I want to save dynamic data when moving to another page我想在移动到另一个页面时保存动态数据
【发布时间】:2019-09-26 23:51:44
【问题描述】:

我想在移动到另一个页面时保存动态数据。你是在画布上画一个图形,如果你想把节点和边的信息保存在画布中,想写的时候写出来,应该用什么方法?

我使用 Django、Python、PHP、jQuery 等。我在 Alloy-UI 中使用图表生成器,我想保存这个画布数据。

<div id="yui_patched_v3_18_1_1_1557380115692_770" class="diagram-node-task yui3-widget yui3-overlay diagram-node yui3-widget-positioned yui3-widget-stacked diagram-node-selected diagram-node-focused" tabindex="1" data-nodeid="diagramNode_field_task780" style="height: 70px; width: 70px; left: 132px; top: 124px; z-index: 100;">
  <div id="yui_patched_v3_18_1_1_1557380115692_772" class="diagram-node-content yui3-widget-stdmod yui3-widget-content-expanded">
    <div class="yui3-widget-bd" style="height: 70px;" id="yui_patched_v3_18_1_1_1557380115692_987">
      <div style="position: absolute; left: 0px; top: 0px; visibility: visible; width: 70px; height: 70px;" id="yui_patched_v3_18_1_1_1557380115692_986">
        <svg:svg pointer-events="none" overflow="auto" id="yui_patched_v3_18_1_1_1557380115692_855" width="77" height="77" viewBox="-7 -7 77 77" style="position: absolute; top: -7px; left: -7px; overflow: auto; visibility: visible; width: 77px; height: 77px;">
          <svg:rect id="yui_patched_v3_18_1_1_1557380115692_859" pointer-events="visiblePainted" shape-rendering="auto" width="55" height="55" x="0" y="0" fill="none" stroke-dasharray="none" stroke="transparent" stroke-linecap="butt" stroke-width="7" stroke-opacity="0" stroke-linejoin="round" transform="matrix(1,0,0,1,8,8)" style="left: 0px; top: 0px;" class="yui3-shape yui3-svgShape yui3-rect yui3-svgRect diagram-node-shape-boundary">
          </svg:rect>
        </svg:svg>
      </div>
    </div>
  </div>
  <div class="diagram-node-label">task780</div>
  <div class="diagram-builder-controls">
    <div id="yui_patched_v3_18_1_1_1557380115692_950" class="btn-toolbar-content yui3-widget component btn-toolbar">
      <button type="button" class="btn btn-default">
          <span class="glyphicon glyphicon-remove">

我想保存节点数据,并将此数据加载到另一个页面。

【问题讨论】:

  • 您可以将日期分配给会话或 cookie 变量,并在下一页中使用它们。

标签: jquery json django


【解决方案1】:

你有两个选择:

  • 首先将数据发布到任何端点,保存数据,然后转到下一页并加载该数据。
  • 如果可以,通过 GET 参数将数据传递到下一页。

【讨论】:

  • 是的,或者您可以通过 POST 将其传递到视图中,然后使用这些参数呈现另一个页面,而无需将它们保存在数据库中。
猜你喜欢
  • 2022-10-24
  • 1970-01-01
  • 2013-07-19
  • 2019-10-24
  • 1970-01-01
  • 1970-01-01
  • 2019-12-03
  • 2011-12-18
  • 2018-10-29
相关资源
最近更新 更多