Marcel Lein
Forum Replies Created
-
Good evening!
I finally got it resolved! Problem where some spaces that I didn’t put.
For anyone curious. Here is the code!
{ “fnRowCallback”: “function(row, data, index)
{ if
(data[6]==’Gesperrt’) { jQuery(row).find(‘td:eq(6)’).css(‘backgroundColor’,’#c74a4a’); }
else if
(data[6]==’Lizensierung erfolgt’) { jQuery(row).find(‘td:eq(6)’).css(‘backgroundColor’,’#467bb8′); }
else if
(data[6]==’Alle Daten vorhanden’) { jQuery(row).find(‘td:eq(6)’).css(‘backgroundColor’,’#48a360′); }
else if
(data[6]==’vor Verkaufsabschluss’) { jQuery(row).find(‘td:eq(6)’).css(‘backgroundColor’,’#e0da58′); }
else if
(data[6]==’Verkauf erfolgt’) { jQuery(row).find(‘td:eq(6)’).css(‘backgroundColor’,’#d158a3′); }
else { jQuery(row).find(‘td:eq(6)’).css(‘backgroundColor’,’inherit’); }
}” }
Thanks alot for your help, Peter. I have learnt so much during the research and due to your answers.
Looking forward for your updates :).
Marcel
Hey Peter,
I sent you the wrong column. Should’ve sent you the column of my “Publish”. I can see the string in the database. I deleted all formatting. Problem still persisted. I also tested with a string that had the same length as my code and tried it with your example code. Problem didn’t exist.
So I guess that there is an error in my function. Sorry :(. I hope to get it resolved somehow.
Thank you for your effort! 🙂
Marcel
Here is a link of the table in sql. Anything wrong here? Or can I change the value of the length?
Thank you really much!
I tried it, and the result is still the same. Downloaded your file, checked for the empty line, saved as .sql with notepad ++ and uploaded/executed the file. No errors.
Console output still: “WP Data Access ERROR: Invalid table options (advanced)”Marcel
Is this option really that huge? 🙂
You have a powerful library with datatables and there are cool options! If I would just know how to use them, as I am just a small student who is experimenting with websites as a hobby.Which file format would I go with, when exporting the ascii file?
Your script import allows sql and zip. I tried to save as .ascii & .sql., but console still giving error. I may have done smth. wrong.Looking forward for your update! 🙂
Marcel
Hey again!
the solution provided by you did work really well! The RowCallback function was what I was refering to! Thank you really much.
Your solution provided one if/else statement. How would I go about formatting with multiple if/else statements.
{“fnRowCallback”: “function(row, data, index) { if (data[6]==’Gesperrt’) { jQuery(row).find(‘td:eq(6)’).css(‘backgroundColor’,’#c74a4a’);} Else if (data[6]==’Lizensierung erfolgt’) {Query(row).find(‘td:eq(6)’).css(‘backgroundColor’,’#467bb8′);} Else if (data[6]== ‘Alle Daten vorhanden’) { jQuery(row).find(‘td:eq(6)’).css(‘backgroundColor’,’#48a360′);} Else if (data[6]==’Vor Verkaufsabschluss’) { jQuery(row).find(‘td:eq(6)’).css(‘backgroundColor’,’#e0da58′);} Else if (data[6]==’Verkauf erfolgt’) { jQuery(row).find(‘td:eq(6)’).css(‘backgroundColor’,’#d158a3′);} Else { jQuery(row).find(‘td:eq(6)’).css(‘backgroundColor’,’white’);}}”}
Is this correct? I get a console datatable options error.
Marcel
Thank you for your nice answer Peter,
didn’t really expect such a cool response!
I can’t really go into detail about your answer today, but I will tomorrow.
One thing to add is, that the demo site currently isn’t working. The console on your provided link outputs this error: “Uncaught TypeError: b.fn.apply is not a function”
Datatable is also “processing”.
Have a good night. Marcel
Ah, the only option, which I didn’t disable during testing. Okay! I’ll try to disable the placeholder for now. Thank you for your kind message. Keep up the nice work.
Greetings Marcel 🙂