jquery / jquerymobile.com

jQuery Mobile web site content
http://jquerymobile.com
Other
54 stars 65 forks source link

Custom Download for Select 1.4.5 broken #119

Closed ankit-link closed 9 years ago

ankit-link commented 9 years ago

I tried using select by downloading only Select from download builder. But, its not working

jaspermdegroot commented 9 years ago

@ankit-link - Can you tell a bit more about what isn't working? I just downloaded "Select" from the builder and it was working as expected. All necessary JS and CSS seems to be in the build as well. Do you get an error message when using the code?

ankit-link commented 9 years ago

@jaspermdegroot - Thanks for the reply. Here's my code can you tell what I'm doing wrong.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<link rel="stylesheet" type="text/css" href="jmobile/jquery.mobile.custom.structure.min.css"/>
<link rel="stylesheet" type="text/css" href="jmobile/jquery.mobile.custom.theme.css"/>
</head>

<body>
<div data-role="page">
  <div data-role="header">
  <h1>Select Menus</h1>
  </div>

  <div data-role="main" class="ui-content">
    <form method="post" action="demoform.asp">
      <fieldset class="ui-field-contain">
        <label for="day">Select Day</label>
        <select name="day" id="day">
          <option value="mon">Monday</option>
          <option value="tue">Tuesday</option>
          <option value="wed">Wednesday</option>
          <option value="thu">Thursday</option>
          <option value="fri">Friday</option>
          <option value="sat">Saturday</option>
          <option value="sun">Sunday</option>
        </select>
      </fieldset>
      <input type="submit" data-inline="true" value="Submit">
    </form>
  </div>
</div>
<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="jmobile/jquery.mobile.custom.js"></script>
</body>
</html>
jaspermdegroot commented 9 years ago

@ankit-link - Maybe you can first explain what "it's not working" means. Is the select not enhanced (ie. not styled as a JQM select button) or does it look ok but your form is not working? Do you get an error message in the console?

ankit-link commented 9 years ago

@jaspermdegroot - Its not getting styled and also selectbox looks like native select. There is no error in console.

jaspermdegroot commented 9 years ago

@ankit-link

When you have a build with only the selectmenu widget and its dependecies, there is no auto-initialization of the widget. Auto-initialization of widgets is part of another component and only works if you use widgets inside a jQuery Mobile page. If you just want to use selectmenu you can initialize the widget like so:

$( "select" ).selectmenu();
ankit-link commented 9 years ago

@jaspermdegroot

Thanks alot. Its working after adding the initialization code