tonytomov / jqGrid

jQuery grid plugin
www.trirand.com
2.85k stars 1.2k forks source link

Formatter function - using options as option list of one column in the table. #878

Closed suadkul closed 7 years ago

suadkul commented 7 years ago

How to use the formatter function and its parameter options as a option list of one column from the same table using jquery ajax and php json.

function formatter(value, options, rowData){ return options = ?????; }

tonytomov commented 7 years ago

Hello,

I Apologize , that I can not understand the question.

Could you please explain it again?

Thank you.

suadkul commented 7 years ago

I apologize for the issue in the wrong topic. Was intended for the footable. As I said earlier, I have a problem with using the formatter function and its parameter "options". I would like to use this parameter to get a list of the second column from the same table, in json form, to display values similar to jtable and its "options" function for a particular column. Best regards.

tonytomov commented 7 years ago

You may want to get help from here: http://www.guriddo.net/documentation/guriddo/javascript/user-guide/formatters/#definition-and-parameters

as far as I understand you can use colModel property of the options in order to get some data.

By example to get second column you can use:

var col2_prop = options.colModel[1]; // zero based 
suadkul commented 7 years ago

Thanks a lot for help and quick response. However the author of the footable had another logic regarding the footable formatter that is not the same as for jQGrid and its parameters. In any case thank you very much.

tonytomov commented 7 years ago

I will close the issue. If you have trouble, you can reopen it.