You are currently browsing the tag archive for the 'cakephp' tag.

Add remove rows + textfields from a table in JS

For a future reminder on JS coding…

<script language=”Javascript” type=”text/javascript”>

/*

tmp is the prefix name of the field
globalform is the name of the form
data[Userpref/'+ tmp +']‘+(n)+’[' = the name of the var of the text field that will keep the value
YES all this code could be made so wouln'd be so redundant ; Life !!
*/    function addField(tmp)
{

input = document.createElement("input");

/* document.getElementById('globalform').appendChild(input); */
var formGl = document.getElementById("globalform");
var allInputs = formGl.getElementsByTagName("input");
var n = allInputs.length;
n = n-2;
input.setAttribute("type", "text");
input.setAttribute("name", 'data[Userpref/'+ tmp +']‘+(n)+’[');

/* document.getElementById('globalform').appendChild(input); */

var row = document.createElement("tr");
row.className = "altRow";

var td1 = document.createElement("td");

td1.appendChild(document.createTextNode(tmp+n+ " Match "));

var td2 = document.createElement("td");
td2.appendChild (input);

row.appendChild(td1);
row.appendChild(td2);

document.getElementById('globalform').getElementsByTagName("table")[0].appendChild(row);

/* Describe field */

input = document.createElement(“input”);
input.setAttribute(“type”, “text”);
input.setAttribute(“name”, ‘Userpref/Describe’+tmp+’]'+(n)+’[');

/* document.getElementById('globalform').appendChild(input); */

var row = document.createElement("tr");
row.className = "evenRow";
var td1 = document.createElement("td");

td1.appendChild(document.createTextNode(tmp + " "+ n + " " + "describe" ));

var td2 = document.createElement("td");
td2.appendChild (input);

row.appendChild(td1);
row.appendChild(td2);

document.getElementById('globalform').getElementsByTagName("table")[0].appendChild(row);

}
/* Remove LastField from the table in the form */
function removeLast()
{
formGl = document.getElementById(“globalform”);
var myTb = formGl.getElementsByTagName(“table”);
var Trs = myTb[0].getElementsByTagName(‘tr’);

myTb[0].removeChild(Trs[Trs.length-1]);
}
</script>

Após algum tempo sem escrever, voltei, agora fora do http://river.tvtel.pt/ já à bastante tempo pensava continuar este novo domínio mas o troca-troca de blog system fez com que isto parasse. Ultimamente com a anunciada compra da empresa onde ainda trabalho e agora de férias criaram um pouco os motivos para que eu recomeçasse a escrever.

Entretanto vou dando um pouco notícias sobre o que andei a fazer, continuação da parte de mailbox’s MX ,backups autonomia e dinamismo do software melhorar a facilidade de utilização, criação de uns novos sistemas de admin em http://dm.tvtel.pt/ com base no cakePHP também no cakephp tenho estado a aprofundar as bases do framework ideias de ver symphony e ZendFramework ficaram por terra devido à falta de tempo.

O mês passado foi um mês dedicado ao pensamento em soluções em cluster mais concretamente o sistema físico e a preocupação da compatibilidade de sistemas de ficheiros em DAS , NAS , Fiber Channel com o Linux. Agora com esse trabalho tendo ficado por terra, virei as minhas atenções para ajudar a organizar um Datacenter e o uso de Hearbeat, para garantir alta disponibilidade de sistemas.

Projectos pessoais estão em curso ( devagar mas em curso ).

Este post serviu também para me centrar um pouco de tudo o que se passou nos últimos dois meses para organização mental digamos.

Fotos do Flickr

Rua perto de Notre Dame

Trocadero garden

Parc Monceau

Topo das casas na Rue Renequin

Notre Dame

Quarto de Luis XV

More Photos

MyBookmarks

My Amazon.com Wish List