0

I am trying to use the jQuery tooltip, which was working before, however I am getting this uncaught type error in the Console in the following line:

$("img[title]").tooltip();

code:

<title></title>
        <link href="Styles/MainMaster.css" rel="stylesheet" type="text/css" />
    <script type='text/javascript' src='/js/jquery.js'></script>
    <script type='text/javascript' src='/js/jquery.simplemodal.js'></script>
      <script type='text/javascript' src="http://cdn.jquerytools.org/1.2.7/full/jquery.tools.min.js"></script>
        <script src="/Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
      <script type="text/javascript">
          $(function () {
              $("img[title]").tooltip();
          });
    </script>
        <link href="Styles/PopUpWindow.css" rel="stylesheet" type="text/css" />
        <script src="/Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
        <asp:ContentPlaceHolder ID="head" runat="server">
        </asp:ContentPlaceHolder>

What could have I done wrong?


Observable CollectionViewSource

I am trying to set up a ListBox that gets it's data from a CollectionViewSource. What I want to happen is that when I update the underlying data source the ListBox also updates. My Xaml looks like this...

<Window.Resources>
    <ObjectDataProvider x:Key="AppTests" ObjectType="{x:Type Application:AppTestProvider}" MethodName="GetAppTests" />
    <CollectionViewSource x:Key="cvs" Source="{StaticResource AppTests}">
        <CollectionViewSource.SortDescriptions>
            <scm:SortDescription PropertyName="Priority" Direction="Ascending" />
        </CollectionViewSource.SortDescriptions>
    </CollectionViewSource>
</Window.Resources>

<Grid>
    <ListBox x:Name="TestList" ItemsSource="{Binding Source={StaticResource cvs}}">
        <ListBox.ItemTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding TestName}" />                    
            </DataTemplate>
        </ListBox.ItemTemplate>
    </ListBox>
</Grid>

This displays the data fine but if I change the underlying data then the changes don't appear on the grid until I call the cvs.View.Refresh() method in the code behind.

How can I make this "observable" so the changes happen automatically?

Note: The reason for using the CVS was to provide sorting to the list based on a property in the underlying objects.

4

1 回答 1

1

问题在于您的脚本冲突。

你应该像这样组织你的脚本:

   <title></title>
    <link href="Styles/MainMaster.css" rel="stylesheet" type="text/css" />
    <script type='text/javascript' src='/js/jquery.js'></script>
    <script type='text/javascript' src='/js/jquery.simplemodal.js'></script>
    <script type='text/javascript' src="http://cdn.jquerytools.org/1.2.7/full/jquery.tools.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $("img[title]").tooltip();
        });
    </script>
    <link href="Styles/PopUpWindow.css" rel="stylesheet" type="text/css" />
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
于 2013-07-29T08:17:42.467 回答