Skip to content

Instantly share code, notes, and snippets.

View bartoszrychlicki's full-sized avatar

Bartosz Rychlicki bartoszrychlicki

  • Gdańsk, Poland
View GitHub Profile
{% block table_widget %}
<<<<<<< HEAD
{% if contentFieldValue != null %}
<script type="text/javascript">
$(document).ready(function(){
var data{{ contentFieldId }} = {{ tableData|raw }};
$("#grid-{{ contentFieldId }}").handsontable({
rows: data{{ contentFieldId }}.length > 0 ? data{{ contentFieldId }}.length : 1,
<<<<<<< HEAD
//print_r(unserialize($form->getParent()->getData()->getValue())); die();
$view->set('contentFieldValue', unserialize($form->getParent()->getData()->getValue()));
$view->set('tableData',json_encode(unserialize($form->getParent()->getData()->getValue())));
$view->set('contentFieldId', $form->getParent()->getData()->getId());
=======
$view->set('templateIndex', $form->getParent()->getData()->getTemplateIndex());
$view->set('tableData', json_encode($form->getData()->getValue()));
>>>>>>> 159f53e1e4629cc11b631b0a79daea77edef4579
<<<<<<< HEAD
// Leeave the lines before, soon we need functionality of editing tables!
$val = $request->request->get($form->getName().'[contentFields]['.$index.'][value]',null,true);
if ($contentField->getType() === \Br\StgCcBundle\Entity\ContentField::TYPE_TABLE) {
$val = serialize(json_decode($val));
=======
$val = $request->request->get($form->getName().'[contentFields]['.$index.'][value][value]',null,true);
if ($contentField->getType() === \Br\StgCcBundle\Entity\ContentField::TYPE_TABLE) {
$val = json_decode($val);
//manual bind to overcome $form->bind() limitations