jQWidgets Forums
Forum Replies Created
-
Author
-
Hi,
I tried initializing the widget in a function which is called from document.ready callback. But still it is not working. Following is the code:
var columns, datafields; $(document).ready(function () { columns = [{ text: 'Product Name', datafield: 'ProductName', width: 250 }, { text: 'Quantity per Unit', datafield: 'QuantityPerUnit', width: 200 }]; datafields = [{ name: 'ProductName', type: 'string' }, { name: 'QuantityPerUnit', type: 'int' }]; LoadGridWithData(); }); function LoadGridWithData() { var source = { datatype: "json", datafields: datafields, url: "Data.jsp", root: 'Rows', beforeprocessing: function (data) { source.totalrecords = data[0].TotalRows; } }; var dataadapter = new $.jqx.dataAdapter(source, { loadError: function (xhr, status, error) { alert(error + ":" + xhr.responseText); } }); $("#gridBatchList").jqxGrid( { source: dataadapter, altrows: true, width: "100%", height: screen.height - 250, selectionmode: selectionmode, filterable: true, enablebrowserselection: true, sortable: true, autoheight: true, pageable: true, columnsresize: true, columnsreorder: true, autorowheight: false, ready: function () { }, columns: columns, }); $("#gridBatchList").on("bindingcomplete", function (event) { gridbindingcomplete(); }); $("#gridBatchList").on("pagechanged", function (event) { gridPageChanged(); }); $("#gridBatchList").on("rowselect", function (event) { gridRowSelect(); }); $("#gridBatchList").on('rowunselect', function (event) { gridRowUnselect(); }); }
The URL of the script tags are also verified and are correct.
Thank You.
Regards
JashFebruary 1, 2017 at 10:19 am in reply to: Grid – Issuse in handling Special character Grid – Issuse in handling Special character #91158Hello,
I did some changes in your code and it worked. Blow is the changed code$(document).ready(function () { var jsonData = '[{\"TotalRows\":\"2\"},' + '{\"Rows\":[' + '{ \"SDE_NAME\":\"MN-25343\", \"SDE_DFS_001\":\"!@#$%%^&^&&**(()_+{}\\\\\\":?><\", \"SDE_DFS_002\":\"zxczfzcfzxczx\"},{ \"SDE_NAME\":\"MN-25342\", \"SDE_DFS_001\":\"Gdfgfg\",\"SDE_DFS_002\":\"gdfgdfg\"}]}]'; //jsonData = JSON.parseJSON(jsonData); var source = { localdata: jsonData, datafields: [{ name: 'SDE_NAME', type: 'string', map: '' }, { name: 'SDE_DFS_001', type: 'string' }, { name: 'SDE_DFS_002', type: 'string' }], root: 'Rows', datatype: "json" }; var dataAdapter = new $.jqx.dataAdapter(source, { beforeLoadComplete: function (records) { console.log(records); return records; }, loadComplete: function () { console.log("loadComplete"); } }); $("#jqxgrid").jqxGrid( { width: 850, source: dataAdapter, autoheight: true, columns: [ { text: 'SDE NAME', datafield: 'SDE_NAME' }, { text: 'SDE DFS 001', datafield: 'SDE_DFS_001' }, { datafield: 'SDE_DFS_002' } ] }); });
Hello,
I saw that all the columns are given width in percentage and because of that the grid is auto-resized.
But is there any API for grid which auto-resizes it based on the container div size?
Thank You.
Regards
JashJanuary 31, 2017 at 12:29 pm in reply to: Grid – Issuse in handling Special character Grid – Issuse in handling Special character #91128Hello,
I tried running the demo in the link you specified. But, in the console, it gives following error:
Error: Invalid character
Please help me solve this problem of handling special characters in the grid.
Thank You.
Regards
JashJanuary 31, 2017 at 6:01 am in reply to: Grid – Issuse in handling Special character Grid – Issuse in handling Special character #91121Hello,
I Appreciate for your help
But Let me put the question in other way … Is there any API to Decode the data when the data is being attach to jqxGrid.and the error it is throwing is jsondata which I m passing it to jqxGrid. the json is as follows :
"[{\"TotalRows\":\"2\"}, {\"Rows\":[ { \"SDE_NAME\":\"MN-25343\", \"SDE_DFS_001\":\"!@#$%%^&^&&**(()_+{}\":?><\", \"SDE_DFS_002\":\"zxczfzcfzxczx\", \"SDE_DFS_003\":\"\", \"SDE_DFS_004\":\"\", \"SDE_DFS_005\":\"siddhi\", \"SDE_DFS_006\":\"null\", \"SDE_DFS_007\":\"\", \"SDE_DFSI_001\":\"MW-LIAS-BE-APP-VM\", \"SDE_DFSI_002\":\"Registration\", \"SDE_DFSI_003\":\"0002019\", \"SDE_DFSI_004\":\"null\", \"SDE_DFSI_005\":\"null\", \"SDE_DFII_001\":\"Open\", \"SDE_DFII_002\":\"Low\", \"SDE_DFII_003\":\"Action\", \"SDE_DFD_001\":\"2017-1-31\", \"SDE_DFD_002\":\"null\", \"SDE_DFD_003\":\"\", \"SDE_DFD_004\":\"2017-1-23\", \"SDE_TYPE\":\"BE_MEMO_NOTES\" }, { \"SDE_NAME\":\"MN-25342\", \"SDE_DFS_001\":\"Gdfgfg\", \"SDE_DFS_002\":\"gdfgdfg\", \"SDE_DFS_003\":\"\", \"SDE_DFS_004\":\"\", \"SDE_DFS_005\":\"siddhi\", \"SDE_DFS_006\":\"null\", \"SDE_DFS_007\":\"\", \"SDE_DFSI_001\":\"MW-LIAS-BE-APP-VM\", \"SDE_DFSI_002\":\"Registration\", \"SDE_DFSI_003\":\"0002019\", \"SDE_DFSI_004\":\"null\", \"SDE_DFSI_005\":\"null\", \"SDE_DFII_001\":\"Open\", \"SDE_DFII_002\":\"Low\", \"SDE_DFII_003\":\"Action\", \"SDE_DFD_001\":\"2017-1-31\", \"SDE_DFD_002\":\"null\", \"SDE_DFD_003\":\"\", \"SDE_DFD_004\":\"2017-1-17\", \"SDE_TYPE\":\"BE_MEMO_NOTES\" }] }]"
December 6, 2016 at 6:03 am in reply to: Getting the date from grid in its format Getting the date from grid in its format #89578Hi,
I tried using the formatDate function. But I want to know which js file I will have to import to use this functionality as it is not getting the method.
Thank You.
Regards
Jash KapasiNovember 23, 2016 at 10:04 am in reply to: Grid Width with Less Columns Grid Width with Less Columns #89255Hi,
My grid width is set to 100% and each column width is set to 50%. Still it shows the white space.
Regards
Jash KapasiNovember 23, 2016 at 9:08 am in reply to: Custom Attribute in Checbox Custom Attribute in Checbox #89251Thank You for the solution. It works well.
Thank You.
It worked for me. I am getting the desired output.
Regards,
JashApril 27, 2015 at 11:54 am in reply to: multiple line data in grid multiple line data in grid #70299I am getting the data from the database in the form of string.
eg.
Hello
How
Are YouI have tried following code to handle new line character:
rsvalue = rsvalue.replaceAll("(\\r|\\n|\\r\\n)+", "\\\\n");
By using the above code my error of loading grid is solved. But the data in my grid looks like:
Hello \n How \n Are You
What I want in the grid should be same as the data.
Is there any workaround to handle new line characters?
Regards,
JashHello,
Thank You for the reply.
We are using OS Windows 8.1 running on a virtual machine and IE version 11. We also observed that it works properly in Google Chrome. The problem occurs only while using IE.
Regards,
JashThank You.
Regards,
JashThanks for your response.
Regards,
JashNovember 14, 2014 at 6:05 am in reply to: Get row count of current page Get row count of current page #62732Thanks for your response.
Regards,
JashThanks for your response.
Regards,
Jash -
AuthorPosts