{"action":"created","issue":{"url":"https://api.github.com/repos/OlegKi/jqGrid-plugins/issues/1","labels_url":"https://api.github.com/repos/OlegKi/jqGrid-plugins/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/OlegKi/jqGrid-plugins/issues/1/comments","events_url":"https://api.github.com/repos/OlegKi/jqGrid-plugins/issues/1/events","html_url":"https://github.com/OlegKi/jqGrid-plugins/issues/1","id":53387783,"number":1,"title":"Font Awesome icons are not showed in inline actions","user":{"login":"johncze","id":4117874,"avatar_url":"https://avatars.githubusercontent.com/u/4117874?v=3","gravatar_id":"","url":"https://api.github.com/users/johncze","html_url":"https://github.com/johncze","followers_url":"https://api.github.com/users/johncze/followers","following_url":"https://api.github.com/users/johncze/following{/other_user}","gists_url":"https://api.github.com/users/johncze/gists{/gist_id}","starred_url":"https://api.github.com/users/johncze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johncze/subscriptions","organizations_url":"https://api.github.com/users/johncze/orgs","repos_url":"https://api.github.com/users/johncze/repos","events_url":"https://api.github.com/users/johncze/events{/privacy}","received_events_url":"https://api.github.com/users/johncze/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-01-05T11:37:46Z","updated_at":"2015-01-08T13:22:58Z","closed_at":null,"body":"![untitled](https://cloud.githubusercontent.com/assets/4117874/5612585/a2235060-94d7-11e4-9059-c7d19dcffbdc.png)\r\n"},"comment":{"url":"https://api.github.com/repos/OlegKi/jqGrid-plugins/issues/comments/69178024","html_url":"https://github.com/OlegKi/jqGrid-plugins/issues/1#issuecomment-69178024","issue_url":"https://api.github.com/repos/OlegKi/jqGrid-plugins/issues/1","id":69178024,"user":{"login":"johncze","id":4117874,"avatar_url":"https://avatars.githubusercontent.com/u/4117874?v=3","gravatar_id":"","url":"https://api.github.com/users/johncze","html_url":"https://github.com/johncze","followers_url":"https://api.github.com/users/johncze/followers","following_url":"https://api.github.com/users/johncze/following{/other_user}","gists_url":"https://api.github.com/users/johncze/gists{/gist_id}","starred_url":"https://api.github.com/users/johncze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johncze/subscriptions","organizations_url":"https://api.github.com/users/johncze/orgs","repos_url":"https://api.github.com/users/johncze/repos","events_url":"https://api.github.com/users/johncze/events{/privacy}","received_events_url":"https://api.github.com/users/johncze/received_events","type":"User","site_admin":false},"created_at":"2015-01-08T13:22:58Z","updated_at":"2015-01-08T13:22:58Z","body":"Hi,\r\nvery thank you for fixed `jQuery.jqGrid.fontAwesome4.js`. I don't know what exactly which part do you want. I am sorry that my code is in coffeescript, but I think coffeescript is great and easier to read than javascript. If you will be to need then I will post javascript built from coffeescript, but code will not be nice. \r\n\r\nThis is my whole file with Table\r\n```coffeescript\r\nclass Table\r\n\r\n\tsearchPrinted: false\r\n\r\n\tconstructor: (colNames, colModel, updateColModel) ->\r\n\t\t@params = JSON.parse $(\"#params\").html()\r\n\t\t@notice = $(\"#notice\")\r\n\t\t@table = $(\"#table\")\r\n\t\t$.jgrid.no_legacy_api = true\r\n\r\n\t\t@table.jqGrid(\"autoWidthColumns\").jqGrid(\"initFontAwesome\").jqGrid('sortableRows', {\r\n\t\t\tupdate: (ev, ui) ->\r\n\t\t\t\titem = ui.item[0]\r\n\t\t\t\tri = item.rowIndex\r\n\t\t\t\titemId = item.id\r\n\t\t\t\tmessage = \"The row with the id=#{itemId} is moved. The new row index is #{ri}\"\r\n\t\t\t\tif ri > 1 and ri < this.rows.length - 1\r\n\t\t\t\t\talert(message + '\\nThe row is inserted between item with rowid=' +\r\n\t\t\t\t\tthis.rows[ri-1].id + ' and the item with the rowid=' +\r\n\t\t\t\t\tthis.rows[ri+1].id);\r\n\t\t\t\telse if ri > 1\r\n\t\t\t\t\talert(\"#{message}\\nThe row is inserted as the last item after the item with rowid=#{this.rows[ri-1].id}\")\r\n\t\t\t\t\talert(\"#{message}\\nThe row is inserted as the first item before the item with rowid=#{this.rows[ri+1].id}\")\r\n\t\t\t\telse\r\n\t\t\t\t\talert(message)\r\n\t\t}).jqGrid(\r\n\t\t\townSearch: true\r\n\t\t\tdatatype: \"local\" # load from array in js\r\n\t\t\tdata: @params.data # data array\r\n\t\t\twidth: \"100%\"\r\n\t\t\theight: \"100%\"\r\n\t\t\trownumbers: true\r\n\t\t\tcolNames: colNames\r\n\t\t\tcolModel: colModel\r\n\t\t\tshrinkToFit: true\r\n\t\t\tignoreCase: true\r\n\t\t\t# multiselect: true\r\n\t\t\tautowidth: true\r\n\t\t\trowNum: 1000000\r\n\t\t\tgridview: true # it will be faster but dont use insertAfterRow\r\n\t\t\tautoencode: true # converts type '<' to 'lt;'\r\n\t\t\t# pager: \"#status\"\r\n\t\t\tediturl: \"clientArray\" # data won't be posted to the server but rather is saved only to the grid\r\n\t\t\tsortname: 'order'\r\n\t\t\tsortorder: \"asc\"\r\n\t\t\tsortable: (permutation) ->\r\n\t\t\t\talert ('permutation=' + permutation.join(','))\r\n\r\n\t\t\trowList: [] # disable page size dropdown\r\n\t\t\tpgbuttons: false # disable page control like next, back button\r\n\t\t\tpgtext: null # disable pager text like 'Page 0 of 10'\r\n\t\t\tviewrecords: false # show total number of records 'View X to Y out of Z'\r\n\r\n\t\t\tonSelectRow: (rowId) =>\r\n\t\t\t\t@saveEditingRow()\r\n\r\n\t\t\tondblClickRow: (rowId, iRow, iCol, e) =>\r\n\t\t\t\t@table.jqGrid 'editRow', rowId, {\r\n\t\t\t\t\tkeys: true,\r\n\t\t\t\t\tfocusField: iCol,\r\n\t\t\t\t\turl: \"clientArray\"\r\n\t\t\t\t\taftersavefunc: (rowId) ->\r\n\t\t\t\t\t\tretypeColumnValues.call table, rowId\r\n\t\t\t\t}\r\n\t\t)\r\n\r\n\t\t@printSearch()\r\n\r\n\t\t$(\"#jqgrid-search-delete\").click (e) ->\r\n\t\t\te = $.Event(\"keyup\");\r\n\t\t\te.which = 13 // # setting ENTER key was pressed\r\n\t\t\tsearchInput = $(\"#jqgrid-search\")\r\n\t\t\tsearchInput.val(\"\")\r\n\t\t\tsearchInput.trigger(e)\r\n\r\n\t\t$(\"#jqgrid-search\").keyup (e) =>\r\n\t\t\trules = []\r\n\t\t\tpostData = @table.jqGrid \"getGridParam\", \"postData\"\r\n\t\t\tcolModel = @table.jqGrid \"getGridParam\", \"colModel\"\r\n\t\t\tsearchText = $(\"#jqgrid-search\").val()\r\n\r\n\t\t\tfor i in [0...colModel.length] by 1\r\n\t\t\t\tcm = colModel[i]\r\n\t\t\t\tif cm.search isnt false and (cm.stype is undefined or cm.stype is \"text\")\r\n\t\t\t\t\trules.push field: cm.name, op: \"cn\", data: searchText\r\n\r\n\t\t\tpostData.filters = JSON.stringify groupOp: \"OR\", rules: rules\r\n\r\n\t\t\t@table.jqGrid \"setGridParam\", { search: true }\r\n\t\t\t@table.trigger \"reloadGrid\", [{page: 1, current: true}]\r\n\r\n\t\t$(\"#add-row\").click (e) =>\r\n\t\t\te.preventDefault()\r\n\t\t\t@saveEditingRow () =>\r\n\t\t\t\t@table.jqGrid \"addRowData\", undefined, \"last\"\r\n\t\t\t\tdataIds = @table.jqGrid \"getDataIDs\"\r\n\t\t\t\tif dataIds.length > 0\r\n\t\t\t\t\t@table.jqGrid \"editRow\", dataIds[dataIds.length-1], {\r\n\t\t\t\t\t\tkeys: true,\r\n\t\t\t\t\t\turl: \"clientArray\"\r\n\t\t\t\t\t\taftersavefunc: (rowId) ->\r\n\t\t\t\t\t\t\tretypeColumnValues.call table, rowId\r\n\t\t\t\t\t\tafterrestorefunc: (rowId) =>\r\n\t\t\t\t\t\t\t@table.jqGrid \"delRowData\", rowId\r\n\t\t\t\t\t}\r\n\r\n\t\t$(\"#save\").click (e) =>\r\n\t\t\te.preventDefault()\r\n\t\t\t@saveEditingRow () =>\r\n\t\t\t\t@showNotice \"Probíhá ukládání na server...\"\r\n\t\t\t\tdata = @table.jqGrid \"getGridParam\", \"data\"\r\n\t\t\t\tfor i in [0...data.length] by 1\r\n\t\t\t\t\tdata[i].id = null if typeof data[i].id is \"string\"\r\n\t\t\t\tjsonData = JSON.stringify data\r\n\r\n\t\t\t\t$.ajax\r\n\t\t\t\t\turl: @params.action\r\n\t\t\t\t\ttype: \"POST\"\r\n\t\t\t\t\tdata: token: @params.token, data: jsonData\r\n\t\t\t\t\tsuccess: (res) =>\r\n\t\t\t\t\t\t@params.token = res.token\r\n\t\t\t\t\t\tif res.code is 0\r\n\t\t\t\t\t\t\tdata = JSON.parse res.data\r\n\t\t\t\t\t\t\t@table.jqGrid \"setGridParam\", {data: data}\r\n\r\n\t\t\t\t\t\t\t# Update column with select\r\n\t\t\t\t\t\t\tif updateColModel and updateColModel.select\r\n\t\t\t\t\t\t\t\tupdCol = updateColModel.select\r\n\t\t\t\t\t\t\t\tparams = getParams res\r\n\r\n\t\t\t\t\t\t\t\tfor id, value of params.colModel\r\n\t\t\t\t\t\t\t\t\t@table.jqGrid 'setColProp', value.name, value if $.inArray(value.name, updCol) >= 0\r\n\r\n\t\t\t\t\t\t\t@table.trigger \"reloadGrid\"\r\n\r\n\t\t\t\t\t\t@showNotice res.msg, @getNoticeTypes res.code\r\n\r\n\t\t\t\t\terror: (error) =>\r\n\t\t\t\t\t\terrText = JSON.parse error.responseText\r\n\t\t\t\t\t\t@showNotice \"Response #{error.status}: #{errText.msg}\", @getNoticeTypes -1\r\n\r\n\tprintSearch: () ->\r\n\t\tunless @searchPrinted and @table.jqGrid \"getGridParam\", \"ownSearch\"\r\n\t\t\tsearchTool = '\r\n\t\t\t\t<div>\r\n\t\t\t\t\t<label for=\"jqgrid-search\">Hledat:&nbsp;</label>\r\n\t\t\t\t\t<input id=\"jqgrid-search\" type=\"text\">&nbsp;\r\n\t\t\t\t\t<button id=\"jqgrid-search-delete\" type=\"button\">Smazat</button>\r\n\t\t\t\t</div>'\r\n\t\t\t@searchTool = $(searchTool)\r\n\t\t\t@table.parent().parent().parent().parent().parent().prepend(@searchTool)\r\n\t\t\t@searchPrinted = true\r\n\r\n\tgetNoticeTypes: (code) ->\r\n\t\tif code > 0\r\n\t\t\treturn \"warning\"\r\n\t\telse if code < 0\r\n\t\t\treturn \"error\"\r\n\r\n\t\treturn \"info\"\r\n\r\n\tsaveEditingRow: (successfunc, errorfunc) ->\r\n\t\t# savedRows array is not empty if some row is in inline editing mode\r\n\t\tsavedRows = @table.jqGrid \"getGridParam\", \"savedRow\"\r\n\t\tsuccess = true\r\n\t\tfor i in [0...savedRows.length] by 1\r\n\t\t\tif savedRows.length > 0\r\n\t\t\t\tresult = @table.jqGrid \"saveRow\", savedRows[i].id, url: \"clientArray\"\r\n\t\t\t\tsuccess = false if not result and success\r\n\t\tif success then successfunc?() else errorfunc?()\r\n\r\n\tshowNotice: (msg, type) ->\r\n\t\t@notice.html msg\r\n\t\t@notice.parent().removeClass \"hidden\"\r\n\r\nvalidateFloat = (value, colName, restr) ->\r\n\t\tpattern = /^(\\+|\\-)?([0]|[1-9]\\d*)((\\.|\\,)\\d+)?$/\r\n\t\treturn [false, \"#{colName} není ve správném formátu např. 23,73.\"] unless pattern.test value\r\n\t\tvalue = value.replace \",\", \".\"\r\n\t\tvalueNumber = parseFloat value\r\n\r\n\t\tif restr?.hasOwnProperty(\"minValueIncl\") and valueNumber < restr.minValueIncl\r\n\t\t\treturn [false, \"#{colName} musí být větší nebo rovno #{restr.minValueIncl}.\"]\r\n\t\tif restr?.hasOwnProperty(\"maxValueIncl\") and valueNumber > restr.maxValueIncl\r\n\t\t\treturn [false, \"#{colName} musí být menší nebo rovno #{restr.maxValueIncl}.\"]\r\n\t\tif restr?.hasOwnProperty(\"minValueExcl\") and valueNumber <= restr.minValueExcl\r\n\t\t\treturn [false, \"#{colName} musí být větší #{restr.minValueExcl}.\"]\r\n\t\tif restr?.hasOwnProperty(\"maxValueExcl\") and valueNumber >= restr.maxValueExcl\r\n\t\t\treturn [false, \"#{colName} musí být menší #{restr.maxValueExcl}.\"]\r\n\t\treturn [true, \"\"]\r\n\r\nvalidateText = (value, colName, restr) ->\r\n\tlength = value?.length\r\n\r\n\tif restr?.hasOwnProperty('minLength') and length < restr.minLength\r\n\t\treturn [false, \"#{colName} musí obsahovat #{restr.minLength} a více znaků.\"]\r\n\tif restr?.hasOwnProperty('maxLength') and length > restr.maxLength\r\n\t\treturn [false, \"#{colName} musí obsahovat #{restr.maxLength} nebo méně znaků.\"]\r\n\r\n\treturn [true, \"\"]\r\n\r\nfloatFormatter = (cellvalue, options, rowObject) ->\r\n\tif cellvalue\r\n\t\tcellvalue = cellvalue + ''\r\n\telse\r\n\t\tcellvalue = ''\r\n\treturn cellvalue.replace \".\", \",\"\r\n\r\nfloatUnformatter = (cellvalue, options, rowObject) ->\r\n\treturn cellvalue.replace \",\", \".\"\r\n\r\nprepareDataForSelect = (data) ->\r\n\tdataForSelect = \"\"\r\n\tfor id, value of data\r\n\t\tdataForSelect += \"#{id}:#{value};\"\r\n\tdataForSelect = dataForSelect.substring(0, dataForSelect.length - 1);\r\n\r\n\treturn dataForSelect\r\n\r\ncolorPickerFormatter = (cellvalue, options, rowObject) ->\r\n\t$(\".colpick\").each () ->\r\n\t\t$(this).remove()\r\n\tunless cellvalue\r\n\t\tcolor = rowObject.color\r\n\t\tcell = \"<div data-value='#{color}' style='border: 1px solid lightgray; width: 20px; height: 20px; background-color: #{color};'/>\"\r\n\telse\r\n\t\tif cellvalue.charAt(0) is \"#\"\r\n\t\t\tcolor = cellvalue\r\n\t\t\tcell = \"<div data-value='#{color}' style='border: 1px solid lightgray; width: 20px; height: 20px; background-color: #{color};'/>\"\r\n\t\telse\r\n\t\t\tcell = cellvalue\r\n\treturn cell\r\n\r\n```"}}