Table Question
#11
You are denied support. I have no experience with the table plugin so would not be able to help you anyway. Sorry. Sad
Reply
#12
(2012-04-10, 05:19 PM)Vicky A Wrote: Hey all, I’m not sure if this has been answered before, but I did a search and I can’t find it. If it's already been answered somewhere, feel free to direct me to it! I’m currently trying to create a two row, two column table and transform it into a MyCode. I want to have one row to be able to be editable by members, whereas the other will have predefined text. I’m wondering if something like this is possible for MyBB, and if so, what would be the regular expression? The code I tried was something like this:

HTML Expression:
<table><tr>
<td>My Text Here</td>
<td>My Text Here</td>
</tr>
<tr>
<td>$1</td>
<td>$2</td>
</tr></table>

I understand that HTML is possible for MyBB, but I do not want to enable that for members, and I want to use MyCode for this particular code. Assistance with this is greatly appreciated! 8D
Here is my function for making a column editable:
function isEditable(rowArray, headersArray)
{
var counter = 0;
var notEditable = ['product code', 'product'];
for(i in rowArray){
counter = 0;
data = headersArray[i].toLowerCase();
for(a in notEditable){
if(data == notEditable[a]){
counter++;
}
}
if(counter > 0){
rowArray[i] += 'notEditable';
}
}
return rowArray;
}

it compares the header of the cell to an array of predefined values which = a non-editable column.

Then I build the row:
function buildHTMLTableRow(row, mutable)
{
output = '';
output += '<tr>';
for(var i = 0; i < row.length; i++)
{
value = trim(row[i]);
if(mutable){
index = value.indexOf('notEditable');
if(index != -1){
value = value.substring(0, index);
output += '<td>' + value + '</td>';
}
else{
output += '<td><input size="5" type="text" value="' + value + '" /></td>';
}
}
else{
output += '<td>' + value + '</td>';
}
}
output += '</tr>';
return output;
}
if you not understand may see
http://www.techyv.com/questions/html-code-problem
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)