Title: [Solved] Changing the datagrid url based on input radio selection Post by: kavvson on October 14, 2014, 07:23:53 AM Code: <div class="adv_filter"> var url = 'lists.php?ltype='+input_radio_value; Code: $("li").on("click", "input", function() { How to get the globalVar isnide Code: $('#dg').datagrid({ SOLVED AT : http://stackoverflow.com/questions/26387676/passing-a-variable-into-an-other-function-jeasyui Title: Re: Changing the datagrid url based on input radio selection Post by: chrwei on October 14, 2014, 07:58:52 AM first problem is that "this" is not going to be the input, off the top of my head you can get that via $("input[name='letter_type']:selected"), or maybe :checked, but that's just jquery stuff.
then, instead of having the params in the url, define the grid like: Code: $('#dg').datagrid({ if you don't want a default then make lists.php return an empty set. then you can use the 'load' method to change the queryParams and load the new data Title: Re: Changing the datagrid url based on input radio selection Post by: kavvson on October 14, 2014, 08:06:18 AM It sounds logical, but I cant move on I don't know how to do that:(
Title: Re: Changing the datagrid url based on input radio selection Post by: chrwei on October 14, 2014, 11:15:49 AM it's in the documentation http://www.jeasyui.com/documentation/index.php# under "Query data with some parameters."
Title: Re: Changing the datagrid url based on input radio selection Post by: kavvson on October 14, 2014, 11:24:35 AM Code: $("li").on("click", "input", function() { Ok but can you tell me how to pass the globalVal to query param? And wont it be static? When I press the checkboxe's will it reload the grid - supposingly no. Title: Re: Changing the datagrid url based on input radio selection Post by: chrwei on October 14, 2014, 11:29:43 AM did you look at the docs on the load method? you don't need reload at all. reload fetches updated data using the same parameters.
Title: Re: Changing the datagrid url based on input radio selection Post by: kavvson on October 14, 2014, 11:47:07 AM The link doesn't refere to that. Its index, and there is no under " ". Could you show a example then?
Title: Re: Changing the datagrid url based on input radio selection Post by: chrwei on October 14, 2014, 11:59:43 AM right from the docs:
Code: $('#dg').datagrid({ Title: Re: Changing the datagrid url based on input radio selection Post by: kavvson on October 14, 2014, 12:26:40 PM that's not what I am looking after also;/
Title: Re: Changing the datagrid url based on input radio selection Post by: chrwei on October 14, 2014, 12:35:31 PM in this case the 'load' call sends name and address query parameters to file.php and reloads the grid data. it's exactly what you asked for. sub in your values.
Title: Re: Changing the datagrid url based on input radio selection Post by: kavvson on October 15, 2014, 03:31:52 AM Code: name: 'easyui', what variables does it take / stands for ( name, address ) cause the default values doesn't tell me anything.. ho ? easyui is the grid id? Title: Re: Changing the datagrid url based on input radio selection Post by: chrwei on October 15, 2014, 07:11:37 AM no, it's just a text string. is this more clear?
Code: $('#dg').datagrid('load', { |