Errors

1.Suppose cells of table has input textboxes to enter/store data.Dont ever try to get the value inside the cells using table-ID,you could easily do it using the id of input text box (obvious point) #javascript #html #php

2. Dont try to load the entire template while outputting your files in pdf…you just have to load only view stripped of any templates…otherwise you will get an error ‘file doesn’t start with %PDF ‘…. #fpdf #php #codeigniter

3. When  checking for null values in javascript, always make sure the variable you compare has a number datatype, if you are checking if the variable is equal to zero or not. Use parseFloat/parseInt for that purpose…

4. If you have to send grid values in a form to controller/server, either use serialize/unserialize, json.stringify(javascript)/json.parse(javascsript) or json_encode(php)/json_decode(php) to convert the values taken in an array to a string and store it in a hidden textbox and convert it back using the functions mentioned above…

Otherwise you can use textbox for the cells of the grid which will be sent automatically when you submit your form. #form #php #javascript

5. Always be careful of single & double quotes around variables/strings in php.

Single quotes is simplest way to specify strings.It doesnt expand variables.

Double quotes will interpret more escape sequences for special characters.Also variable name will be expanded.

6. Always check the special conditions first in a set of if…elseif…if condition…check for the general condition last…

7. During Server validation in Codeigniter, always put your call back function in your controller,even if you do your server validation check in CI model….

8. Always be careful about the position of the script inside a View…for eg. if you want to change property of elements  in a View based on a condition in PHP using a script,they have to be placed at the bottom – after the default definition of the elements(normally script is placed at the top)

9. JqxGrid :

– include appropriate libraries

– when adding checkbox,always make the grid option editable to true.New editions have checkbox type

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s