EasyUI Forum
March 17, 2025, 05:17:20 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
  Home Help Search Login Register  
  Show Posts
Pages: [1]
1  General Category / General Discussion / Re: Combobox select default - HOW on: December 26, 2013, 10:53:12 AM
SOLVED...thanks 'ryupanqul'

Code:
$rs = mysql_query("SELECT unitID FROM unit ORDER BY case when unitID = 'All' THEN 0 ELSE 1 END, unitID");
$items = array();
while($row = mysql_fetch_object($rs)){

if ($row->unitID == 'ALL') {
$row->selected = true;
}

array_push($items, $row);
}

$result = $items;
echo json_encode ($result);
2  General Category / General Discussion / Re: Combobox select default - HOW on: December 25, 2013, 09:31:06 AM
I have not been able to add the ,"selected":true into that array push item
Code:
$items = array();

while($row = mysql_fetch_object($rs)){
     // PSEDUO Code IF 'All' THEN
     array_push($items, $row + ',"selected":true');  [b]///I'M STUCK HERE...HOW TO CONCAT INTO THIS ITEM[/b]
     //ELSE
    array_push($items, $row);
   }
   
$result = $items;
echo json_encode ($result);

3  General Category / General Discussion / Combobox select default - HOW on: December 23, 2013, 07:38:58 AM
I have a combobox:

Code:
<input id="unit_FIELD" class="easyui-combobox"
        name="unit_FIELD" data-options=" url:'get_units.php',
valueField:'unitID',
textField:'unitID'
        ">

I'm populating the ComboBox just fine with the get_units.php code.

Code:
[{"unitID":"ALL"},{"unitID":"001"},{"unitID":"002"},{"unitID":"003"},{"unitID":"004"}]

I need to be able to have a default selected...How do I select the first item in the combox by default WHEN the combobox is popluated from a Database?

-Tom
4  General Category / EasyUI for jQuery / Re: Pass Greater Then / Less Then ? on: December 07, 2013, 12:35:03 PM
as soon as I posted i found the error

my POST variables did not match  Roll Eyes

Code:
yearFilter_POST
5  General Category / EasyUI for jQuery / Pass Greater Then / Less Then ? on: December 07, 2013, 12:19:18 PM
Can someone take a double look, and see why I cannot pass my year FILTEr values over to my PHP page...I think its becuase I;m trying to pass "<, >, =, <="...and that is breaking somehting???

I have two search fields:  Year and Year_Filter

Code:
<input id="year_FIELD" class="easyui-combobox"
        name="year_FIELD" data-options=" data: [
{yearID:'',year:'ALL'},
{yearID:'2013',year:'2013'},
{yearID:'2012',year:'2012'},
{yearID:'2011',year:'2011'},
{yearID:'2010',year:'2010'},
{yearID:'2009',year:'2009'}
],
valueField:'yearID',
textField:'year',
panelHeight:'auto'
        ">

<input id="year_FILTER" class="easyui-combobox"
        name="year_FILTER" data-options=" data: [
{value:'', label:'No Filter'},
{value:'=', label:'Equal'},
{value:'<>', label:'Not Equal'},
{value: '>', label:'Greater Then'},
{value:'<', label:'Less Then'},
{value:'>=', label:'Greater Then OR Equal'}
],
valueField:'value',
textField:'label',
panelHeight:'auto'
        ">


When the search button is clicked...those values are sent the PHP page:

Code:
<script type="text/javascript">
function doSearch(){
$('#tt').datagrid('load',{
                                yearPOST: $('#year_FIELD').combobox('getValue'),
                                yearFilterPOST: $('#year_FILTER').combobox('getValue')
});
}
</script>

My PHP code captures IS NOT CAPTURING THE YEAR_FILTER Value:

Code:
$year_year = isset($_POST['yearPOST']) ? mysql_real_escape_string($_POST['yearPOST']) : '2012';
$year_FILTER = isset($_POST['yearFilter_POST']) ? $_POST['yearFilter_POST'] : '=';

Here is my WHERE statement:

Code:
$where = "year_year $year_FILTER $year_year";
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!